/** * Find the type definition for a class given the class's declaration. * * @param declaration The declaration. * @return The type definition. */ protected TypeDefinition createTypeDefinition(TypeElement declaration) { declaration = narrowToAdaptingType(declaration); if (isEnumType(declaration)) { if (declaration.getAnnotation(XmlQNameEnum.class) != null) { return new QNameEnumTypeDefinition(declaration, this); } else { return new EnumTypeDefinition(declaration, this); } } else { ObjectTypeDefinition typeDef = new ObjectTypeDefinition(declaration, this); if (typeDef.getValue() != null) { return new SimpleTypeDefinition(typeDef); } else { return typeDef; } } }
/** * Find the type definition for a class given the class's declaration. * * @param declaration The declaration. * @return The type definition. */ protected TypeDefinition createTypeDefinition(TypeElement declaration) { declaration = narrowToAdaptingType(declaration); if (isEnumType(declaration)) { if (declaration.getAnnotation(XmlQNameEnum.class) != null) { return new QNameEnumTypeDefinition(declaration, this); } else { return new EnumTypeDefinition(declaration, this); } } else { ObjectTypeDefinition typeDef = new ObjectTypeDefinition(declaration, this); if (typeDef.getValue() != null) { return new SimpleTypeDefinition(typeDef); } else { return typeDef; } } }