/** * Creates a new StringMethodConstraints instance from BasicMethodConstraints. * * @param constraints */ public StringMethodConstraints(BasicMethodConstraints constraints){ this(true, convert(constraints.getMethodDescs())); }
private static StringMethodDesc[] convert(MethodDesc[] descs){ int len = descs.length; StringMethodDesc[] result = new StringMethodDesc[len]; for (int i = 0; i < len; i++){ result [i] = descs[i].getName() != null ? new StringMethodDesc( descs[i].getName(), descs[i].getParameterTypes(), descs[i].getConstraints() ) : new StringMethodDesc(descs[i].getConstraints()); } check(result); return result; }
/** * Returns a hash code value for this object. */ public int hashCode() { return hash(descs); }
/** * Creates an instance that maps all methods to the specified constraints. * The constraints can be <code>null</code>, which is treated the same as * an empty instance. Calling this constructor is equivalent to * constructing an instance of this class with an array containing a * single default descriptor constructed with the specified constraints. * * @param constraints the constraints, or <code>null</code> */ public BasicMethodConstraints(InvocationConstraints constraints) { descs = new MethodDesc[]{new MethodDesc(constraints)}; }
/** * Returns a string representation of this object. */ public String toString() { StringBuffer buf = new StringBuffer("MethodDesc["); toString(buf, true); buf.append(']'); return buf.toString(); }
/** * Returns true if all elements of the set are trusted instances. */ private static boolean trusted(Set set, TrustVerifier.Context ctx) throws RemoteException { return trusted(set.iterator(), ctx); }
/** * Returns a string representation of this object. */ public String toString() { StringBuffer buf = new StringBuffer("MethodDesc["); toString(buf, true); buf.append(']'); return buf.toString(); }
StringMethodDesc(String name, String[] types, InvocationConstraints constraints) { this( check(name, types), name, types, constraints ); }
/** * Creates an instance that maps all methods to the specified constraints. * The constraints can be <code>null</code>, which is treated the same as * an empty instance. Calling this constructor is equivalent to * constructing an instance of this class with an array containing a * single default descriptor constructed with the specified constraints. * * @param constraints the constraints, or <code>null</code> */ public StringMethodConstraints(InvocationConstraints constraints) { descs = new StringMethodDesc[]{new StringMethodDesc(constraints)}; }
/** * Returns a hash code value for this object. */ public int hashCode() { return hash(descs); }
public MethodDesc(GetArg arg) throws IOException, ClassNotFoundException{ this(checkSerial( arg.get("name", null, String.class), arg.get("types", null, Class[].class), arg.get("constraints", null, InvocationConstraints.class) ), (String) arg.get("name", null), (Class[]) arg.get("types", null), (InvocationConstraints) arg.get("constraints", null) ); }
public StringMethodDesc(GetArg arg) throws IOException, ClassNotFoundException{ this(checkSerial( arg.get("name", null, String.class), arg.get("types", null, String[].class), arg.get("constraints", null, InvocationConstraints.class) ), (String) arg.get("name", null), (String[]) arg.get("types", null), (InvocationConstraints) arg.get("constraints", null) ); }
/** * Creates an instance that maps all methods to the specified constraints. The constraints can * be <code>null</code>, which is treated the same as an empty instance. Calling this * constructor is equivalent to constructing an instance of this class with an array containing * a single default descriptor constructed with the specified constraints. * * @param constraints the constraints, or <code>null</code> */ public BasicMethodConstraints(InvocationConstraints constraints) { descs = new MethodDesc[]{new MethodDesc(constraints)}; }
/** * Returns a string representation of this object. */ public String toString() { StringBuffer buf = new StringBuffer("MethodDesc["); toString(buf, true); buf.append(']'); return buf.toString(); }
/** * Returns a hash code value for this object. */ public int hashCode() { return hash(descs); }
/** * Returns true if all elements of the set are trusted instances. */ private static boolean trusted(Set set, TrustVerifier.Context ctx) throws RemoteException { return trusted(set.iterator(), ctx); }
/** * Returns a string representation of this object. */ public String toString() { StringBuffer buf = new StringBuffer("BasicMethodConstraints{"); for (int i = 0; i < descs.length; i++) { if (i > 0) { buf.append(", "); } descs[i].toString(buf, true); } buf.append('}'); return buf.toString(); }
/** * Returns a string representation of this object. */ public String toString() { StringBuffer buf = new StringBuffer("BasicMethodConstraints{"); for (int i = 0; i < descs.length; i++) { if (i > 0) { buf.append(", "); } descs[i].toString(buf, true); } buf.append('}'); return buf.toString(); }