Search in sources :

Example 1 with JsonType

use of com.webcohesion.enunciate.modules.jackson.model.types.JsonType in project enunciate by stoicflame.

the class ObjectDataTypeImpl method getSupertypes.

@Override
public List<DataTypeReference> getSupertypes() {
    ArrayList<DataTypeReference> supertypes = null;
    JsonType supertype = this.typeDefinition.getSupertype();
    while (supertype != null) {
        if (supertypes == null) {
            supertypes = new ArrayList<DataTypeReference>();
        }
        supertypes.add(new DataTypeReferenceImpl(supertype, registrationContext));
        supertype = supertype instanceof JsonClassType ? ((JsonClassType) supertype).getTypeDefinition() instanceof ObjectTypeDefinition ? ((ObjectTypeDefinition) ((JsonClassType) supertype).getTypeDefinition()).getSupertype() : null : null;
    }
    return supertypes;
}
Also used : JsonType(com.webcohesion.enunciate.modules.jackson.model.types.JsonType) ObjectTypeDefinition(com.webcohesion.enunciate.modules.jackson.model.ObjectTypeDefinition) JsonClassType(com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType)

Example 2 with JsonType

use of com.webcohesion.enunciate.modules.jackson.model.types.JsonType in project enunciate by stoicflame.

the class Member method getAccessorType.

/**
 * The type of an element accessor can be specified by an annotation.
 *
 * @return The accessor type.
 */
@Override
public DecoratedTypeMirror getAccessorType() {
    if (this.explicitType != null) {
        return this.explicitType;
    }
    JsonType specifiedJsonType = JsonTypeFactory.findSpecifiedType(this, this.context);
    DecoratedTypeMirror specifiedType = specifiedJsonType instanceof JsonClassType ? (DecoratedTypeMirror) ((JsonClassType) specifiedJsonType).getTypeDefinition().asType() : null;
    if (specifiedType != null) {
        return specifiedType;
    }
    return super.getAccessorType();
}
Also used : JsonType(com.webcohesion.enunciate.modules.jackson.model.types.JsonType) DecoratedTypeMirror(com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror) JsonClassType(com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType)

Aggregations

JsonClassType (com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType)2 JsonType (com.webcohesion.enunciate.modules.jackson.model.types.JsonType)2 DecoratedTypeMirror (com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror)1 ObjectTypeDefinition (com.webcohesion.enunciate.modules.jackson.model.ObjectTypeDefinition)1