@Override protected AegisType getOrCreateMapKeyType(TypeClassInfo info) { AegisType type = null; if (info.getKeyType() != null) { type = createTypeFromGeneric(info.getKeyType()); } if (type == null) { type = super.getOrCreateMapKeyType(info); } return type; }
@Override public AegisType createCollectionType(TypeClassInfo info) { /* If it is a parameterized type, then we already know * the parameter(s) and we don't need to fish them out of the XML. */ if (info.getType() instanceof Class) { return createCollectionTypeFromGeneric(info); } return nextCreator.createCollectionType(info); }
@Override protected AegisType getOrCreateGenericType(TypeClassInfo info) { AegisType type = null; if (info.getType() instanceof ParameterizedType) { type = createTypeFromGeneric(info.getType()); } if (type == null) { type = super.getOrCreateGenericType(info); } return type; }
protected QName createMapQName(TypeClassInfo info, AegisType keyType, AegisType valueType) { String name = keyType.getSchemaType().getLocalPart() + '2' + valueType.getSchemaType().getLocalPart(); Class<?> cls = TypeUtil.getTypeRelatedClass(info.getType()); name += cls.getSimpleName(); // TODO: Get namespace from XML? return new QName(tm.getMappingIdentifierURI(), name); }
@Override protected AegisType getOrCreateMapValueType(TypeClassInfo info) { AegisType type = null; if (info.getType() instanceof ParameterizedType) { // well, let's hope that someone has filled in the value type. type = createTypeFromGeneric(info.getValueType()); } if (type == null) { type = super.getOrCreateMapValueType(info); } return type; }
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 AegisType createEnumType(TypeClassInfo info) { Element mapping = findMapping(info.getType()); if (mapping != null) { return super.createEnumType(info); } return nextCreator.createEnumType(info); }
public void register(Type javaType, QName xmlType, AegisType type) { type.setSchemaType(xmlType); type.setTypeClass(javaType); register(type); }
private static void defaultRegister(TypeMapping tm, boolean defaultNillable, Class<?> class1, QName name, AegisType type) { if (!defaultNillable) { type.setNillable(false); } tm.register(class1, name, type); }
@Override protected boolean isEnum(Class<?> javaType) { Element mapping = findMapping(javaType); if (mapping != null) { return super.isEnum(javaType); } return nextCreator.isEnum(javaType); }
public QName getElementName(Method m, int index) { TypeClassInfo info = createClassInfo(m, index); return info.getMappedName(); }
/** * Insist that a Type is a parameterized type of one parameter. * This is used to decompose Holders, for example. * @param type the type * @return the parameter, or null if the type is not what we want. */ public static Type getSingleTypeParameter(Type type) { return getSingleTypeParameter(type, 0); }
@Override protected AegisType getOrCreateMapValueType(TypeClassInfo info) { AegisType type = null; if (info.getType() instanceof ParameterizedType) { // well, let's hope that someone has filled in the value type. type = createTypeFromGeneric(info.getValueType()); } if (type == null) { type = super.getOrCreateMapValueType(info); } return type; }
@Override protected AegisType getOrCreateMapKeyType(TypeClassInfo info) { AegisType type = null; if (info.getKeyType() != null) { type = createTypeFromGeneric(info.getKeyType()); } if (type == null) { type = super.getOrCreateMapKeyType(info); } return type; }
@Override public AegisType createCollectionType(TypeClassInfo info) { /* If it is a parameterized type, then we already know * the parameter(s) and we don't need to fish them out of the XML. */ if (info.getType() instanceof Class) { return createCollectionTypeFromGeneric(info); } return nextCreator.createCollectionType(info); }
@Override protected AegisType getOrCreateGenericType(TypeClassInfo info) { AegisType type = null; if (info.getType() instanceof ParameterizedType) { type = createTypeFromGeneric(info.getType()); } if (type == null) { type = super.getOrCreateGenericType(info); } return type; }
@Override public AegisType createEnumType(TypeClassInfo info) { Element mapping = findMapping(info.getType()); if (mapping != null) { return super.createEnumType(info); } return nextCreator.createEnumType(info); }
public void register(Type javaType, QName xmlType, AegisType type) { type.setSchemaType(xmlType); type.setTypeClass(javaType); register(type); }
private static void defaultRegister(TypeMapping tm, boolean defaultNillable, Class<?> class1, QName name, AegisType type) { if (!defaultNillable) { type.setNillable(false); } tm.register(class1, name, type); }
@Override protected boolean isEnum(Class<?> javaType) { Element mapping = findMapping(javaType); if (mapping != null) { return super.isEnum(javaType); } return nextCreator.isEnum(javaType); }