private static Class getType( ConfigProperty property, Class type){ Class configPropertyType = property.type(); if (configPropertyType.equals(Object.class)) { configPropertyType = type; } return configPropertyType; }
private static String validateField(Field f, ConfigProperty property){ Class c = f.getDeclaringClass(); Class returnType = f.getType(); Class type = property.type(); if (type.equals(Object.class)) { type = returnType; } else { //check compatibility between annotation type and return-type if (!returnType.isAssignableFrom(type)) { return "annotation type [" + type + "] " + "and return-type [" + returnType + "] " + "are not assignment compatible for @ConfigProperty in " + "field [ " + f.getName() + " ] of class [ " + c + " ]"; } } return SUCCESS; }
private String getConfigPropertyType(final javax.resource.spi.ConfigProperty annotation, final Class<?> type) { Class<?> t = annotation == null ? null : annotation.type(); if (t == null && type != null) { return type.getName(); } else if (t == null) { return null; } if (t.equals(Object.class)) { t = type; } if (t == null) { // t == null && type == null return null; } if (t.isPrimitive()) { t = getWrapper(t.getName()); } return t.getName(); }
private String getConfigPropertyType(final javax.resource.spi.ConfigProperty annotation, final Class<?> type) { Class<?> t = annotation == null ? null : annotation.type(); if (t == null && type != null) { return type.getName(); } else if (t == null) { return null; } if (t.equals(Object.class)) { t = type; } if (t == null) { // t == null && type == null return null; } if (t.isPrimitive()) { t = getWrapper(t.getName()); } return t.getName(); }
Class type = property.type(); Class[] parameters = m.getParameterTypes(); Class propertyType;
new XsdString(getConfigPropertyType(annotation, configPropertyAnnotation.type(), classLoader), null);