Search in sources :

Example 6 with XmlType

use of com.webcohesion.enunciate.modules.jaxb.model.types.XmlType in project enunciate by stoicflame.

the class ComplexDataTypeImpl method getSupertypes.

@Override
public List<DataTypeReference> getSupertypes() {
    ArrayList<DataTypeReference> supertypes = null;
    XmlType supertype = this.typeDefinition.getBaseType();
    while (supertype != null) {
        if (supertypes == null) {
            supertypes = new ArrayList<DataTypeReference>();
        }
        supertypes.add(new DataTypeReferenceImpl(supertype, false, registrationContext));
        supertype = supertype instanceof XmlClassType ? ((XmlClassType) supertype).getTypeDefinition() instanceof ComplexTypeDefinition ? ((XmlClassType) supertype).getTypeDefinition().getBaseType() : null : null;
    }
    return supertypes;
}
Also used : XmlClassType(com.webcohesion.enunciate.modules.jaxb.model.types.XmlClassType) XmlType(com.webcohesion.enunciate.modules.jaxb.model.types.XmlType)

Example 7 with XmlType

use of com.webcohesion.enunciate.modules.jaxb.model.types.XmlType in project enunciate by stoicflame.

the class EnumTypeDefinition method getBaseType.

// Inherited.
@Override
public XmlType getBaseType() {
    XmlType xmlType = KnownXmlType.STRING;
    if (xmlEnum != null) {
        DecoratedTypeMirror typeMirror = Annotations.mirrorOf(new Callable<Class<?>>() {

            @Override
            public Class<?> call() throws Exception {
                return xmlEnum.value();
            }
        }, this.env);
        xmlType = XmlTypeFactory.getXmlType(typeMirror, this.context);
    }
    return xmlType;
}
Also used : DecoratedTypeMirror(com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror) EnunciateException(com.webcohesion.enunciate.EnunciateException) MirroredTypeException(javax.lang.model.type.MirroredTypeException) XmlType(com.webcohesion.enunciate.modules.jaxb.model.types.XmlType) KnownXmlType(com.webcohesion.enunciate.modules.jaxb.model.types.KnownXmlType)

Aggregations

XmlType (com.webcohesion.enunciate.modules.jaxb.model.types.XmlType)7 DecoratedTypeMirror (com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror)3 XmlClassType (com.webcohesion.enunciate.modules.jaxb.model.types.XmlClassType)3 EnunciateException (com.webcohesion.enunciate.EnunciateException)2 TypeDefinition (com.webcohesion.enunciate.modules.jaxb.model.TypeDefinition)2 TypeMirror (javax.lang.model.type.TypeMirror)2 DataType (com.webcohesion.enunciate.api.datatype.DataType)1 DataTypeReference (com.webcohesion.enunciate.api.datatype.DataTypeReference)1 MediaTypeDescriptor (com.webcohesion.enunciate.api.resources.MediaTypeDescriptor)1 FacetFilter (com.webcohesion.enunciate.facets.FacetFilter)1 DecoratedElement (com.webcohesion.enunciate.javac.decorations.element.DecoratedElement)1 DecoratedDeclaredType (com.webcohesion.enunciate.javac.decorations.type.DecoratedDeclaredType)1 JavaDoc (com.webcohesion.enunciate.javac.javadoc.JavaDoc)1 DocumentationExample (com.webcohesion.enunciate.metadata.DocumentationExample)1 DataTypeReferenceImpl (com.webcohesion.enunciate.modules.jaxb.api.impl.DataTypeReferenceImpl)1 Accessor (com.webcohesion.enunciate.modules.jaxb.model.Accessor)1 Attribute (com.webcohesion.enunciate.modules.jaxb.model.Attribute)1 ComplexTypeDefinition (com.webcohesion.enunciate.modules.jaxb.model.ComplexTypeDefinition)1 KnownXmlType (com.webcohesion.enunciate.modules.jaxb.model.types.KnownXmlType)1 TemplateModel (freemarker.template.TemplateModel)1