use of com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType 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;
}
use of com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType in project enunciate by stoicflame.
the class ObjectDataTypeImpl method gatherInterfaces.
private void gatherInterfaces(TypeElement clazz, Set<DataTypeReference> interfaces) {
if (clazz == null) {
return;
}
if (clazz.getQualifiedName().contentEquals(Object.class.getName())) {
return;
}
List<? extends TypeMirror> ifaces = clazz.getInterfaces();
for (TypeMirror iface : ifaces) {
DecoratedTypeMirror decorated = (DecoratedTypeMirror) iface;
decorated = this.typeDefinition.getContext().resolveSyntheticType(decorated);
TypeDefinition typeDefinition = this.typeDefinition.getContext().findTypeDefinition(((DeclaredType) decorated).asElement());
if (typeDefinition != null) {
interfaces.add(new DataTypeReferenceImpl(new JsonClassType(typeDefinition), registrationContext));
}
}
TypeMirror superclass = clazz.getSuperclass();
if (superclass instanceof DeclaredType) {
gatherInterfaces((TypeElement) ((DeclaredType) superclass).asElement(), interfaces);
}
}
use of com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType 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();
}
Aggregations