Exemple #1
0
 private T newContextObject() {
   try {
     if (type.isInterface()) {
       return (T) Classes.newDynamicProxy(type);
     } else {
       return (T) type.newInstance();
     }
   } catch (Exception anExc) {
     throw new XmlReadingException(anExc);
   }
 }
 public boolean isEqualsOnly(final Node node) {
   final Class<?> propertyType = node.getType();
   if (propertyType != null) {
     if (propertyType.getAnnotation(ObjectDiffEqualsOnlyType.class) != null) {
       return true;
     }
     if (equalsOnlyTypes.contains(propertyType)) {
       return true;
     }
     if (Classes.isSimpleType(propertyType)) {
       return true;
     }
   }
   if (node.isEqualsOnly()) {
     return true;
   }
   if (equalsOnlyProperties.contains(node.getPropertyPath())) {
     return true;
   }
   return false;
 }
Exemple #3
0
 private void installClasses(Classes cs) {
   for (Enumeration e = cs.getElements(); e.hasMoreElements(); ) {
     installClass(new CgenNode((Class_) e.nextElement(), CgenNode.NotBasic, this));
   }
 }
Exemple #4
0
 public ContextMutator(Class<?> aFor, Class<T> aWith, String aTagName) {
   method = Classes.getMutatorMethod(aFor, aWith.getSimpleName(), aTagName);
 }