@Override public TypeClassInfo createClassInfo(Method m, int index) { TypeClassInfo info = new TypeClassInfo(); info.setDescription("method " + m.getName() + " parameter " + index); if (index >= 0) { info.setType(m.getParameterTypes()[index]); } else { info.setType(m.getReturnType()); } return info; }
@Override public TypeClassInfo createClassInfo(Method m, int index) { TypeClassInfo info = new TypeClassInfo(); info.setDescription("method " + m.getName() + " parameter " + index); if (index >= 0) { info.setType(m.getParameterTypes()[index]); } else { info.setType(m.getReturnType()); } return info; }
@Override public TypeClassInfo createClassInfo(PropertyDescriptor pd) { Type genericType = pd.getReadMethod().getGenericReturnType(); TypeClassInfo info = createBasicClassInfo(pd.getPropertyType()); info.setType(genericType); // override basicClassInfo's of the type. info.setAnnotations(pd.getReadMethod().getAnnotations()); info.setAegisTypeClass(castToAegisTypeClass(annotationReader.getType(pd.getReadMethod()))); info.setFlat(annotationReader.isFlat(pd.getReadMethod().getAnnotations())); return info; }
@Override public TypeClassInfo createClassInfo(PropertyDescriptor pd) { Type genericType = pd.getReadMethod().getGenericReturnType(); TypeClassInfo info = createBasicClassInfo(pd.getPropertyType()); info.setType(genericType); // override basicClassInfo's of the type. info.setAnnotations(pd.getReadMethod().getAnnotations()); info.setAegisTypeClass(castToAegisTypeClass(annotationReader.getType(pd.getReadMethod()))); info.setFlat(annotationReader.isFlat(pd.getReadMethod().getAnnotations())); return info; }
/** * Create an Aegis type from a reflected type description. * This will only work for the restricted set of collection * types supported by Aegis. * @param t the reflected type. * @return the type */ public AegisType createType(Type t) { TypeClassInfo info = new TypeClassInfo(); info.setType(t); info.setDescription("reflected type " + t.toString()); return createTypeForClass(info); }
/** * Create an Aegis type from a reflected type description. * This will only work for the restricted set of collection * types supported by Aegis. * @param t the reflected type. * @return the type */ public AegisType createType(Type t) { TypeClassInfo info = new TypeClassInfo(); info.setType(t); info.setDescription("reflected type " + t.toString()); return createTypeForClass(info); }
public TypeClassInfo createBasicClassInfo(Type type) { TypeClassInfo info = new TypeClassInfo(); Class<?> typeClass = TypeUtil.getTypeClass(type, false); if (typeClass != null) { info.setDescription("class '" + typeClass.getName() + "'"); } else { info.setDescription("type '" + type + "'"); } info.setType(type); return info; }
protected AegisType createHolderType(TypeClassInfo info) { Type heldType = TypeUtil.getSingleTypeParameter(info.getType(), 0); if (heldType == null) { throw new UnsupportedOperationException("Invalid holder type " + info.getType()); } info.setType(heldType); return createType(heldType); }
public TypeClassInfo createBasicClassInfo(Type type) { TypeClassInfo info = new TypeClassInfo(); Class<?> typeClass = TypeUtil.getTypeClass(type, false); if (typeClass != null) { info.setDescription("class '" + typeClass.getName() + "'"); } else { info.setDescription("type '" + type + "'"); } info.setType(type); return info; }
protected AegisType createHolderType(TypeClassInfo info) { Type heldType = TypeUtil.getSingleTypeParameter(info.getType(), 0); if (heldType == null) { throw new UnsupportedOperationException("Invalid holder type " + info.getType()); } info.setType(heldType); return createType(heldType); }
@Override public TypeClassInfo createClassInfo(PropertyDescriptor pd) { Element mapping = findMapping(pd.getReadMethod().getDeclaringClass()); if (mapping == null) { return nextCreator.createClassInfo(pd); } Element propertyEl = getMatch(mapping, "./property[@name='" + pd.getName() + "']"); if (propertyEl == null) { return nextCreator.createClassInfo(pd); } TypeClassInfo info = new TypeClassInfo(); Type returnType = pd.getReadMethod().getGenericReturnType(); info.setType(returnType); info.setDescription("property " + pd.getDisplayName()); readMetadata(info, mapping, propertyEl); return info; }
@Override public TypeClassInfo createClassInfo(PropertyDescriptor pd) { Element mapping = findMapping(pd.getReadMethod().getDeclaringClass()); if (mapping == null) { return nextCreator.createClassInfo(pd); } Element propertyEl = getMatch(mapping, "./property[@name='" + pd.getName() + "']"); if (propertyEl == null) { return nextCreator.createClassInfo(pd); } TypeClassInfo info = new TypeClassInfo(); Type returnType = pd.getReadMethod().getGenericReturnType(); info.setType(returnType); info.setDescription("property " + pd.getDisplayName()); readMetadata(info, mapping, propertyEl); return info; }
info.setType(paramType, paramType instanceof ParameterizedType ? pm : null);
info.setType(paramType, paramType instanceof ParameterizedType ? pm : null);