public boolean isKnownTypeDefinition(TypeElement el) { return findTypeDefinition(el) != null || isKnownType(el); }
public boolean isKnownTypeDefinition(TypeElement el) { return findTypeDefinition(el) != null || isKnownType(el); }
@Override public List<DataType> findDataTypes(String name) { if (name != null && !name.isEmpty()) { TypeElement typeElement = this.context.getContext().getProcessingEnvironment().getElementUtils().getTypeElement(name); if (typeElement != null) { TypeDefinition typeDefinition = this.context.findTypeDefinition(typeElement); if (typeDefinition instanceof ObjectTypeDefinition) { return Collections.singletonList((DataType) new ObjectDataTypeImpl((ObjectTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { return Collections.singletonList((DataType) new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } } return Collections.emptyList(); }
@Override public List<DataType> findDataTypes(String name) { if (name != null && !name.isEmpty()) { TypeElement typeElement = this.context.getContext().getProcessingEnvironment().getElementUtils().getTypeElement(name); if (typeElement != null) { TypeDefinition typeDefinition = this.context.findTypeDefinition(typeElement); if (typeDefinition instanceof ObjectTypeDefinition) { return Collections.singletonList((DataType) new ObjectDataTypeImpl((ObjectTypeDefinition) typeDefinition, registrationContext)); } else if (typeDefinition instanceof EnumTypeDefinition) { return Collections.singletonList((DataType) new EnumDataTypeImpl((EnumTypeDefinition) typeDefinition, registrationContext)); } } } return Collections.emptyList(); }
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); } }
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); } }
public void add(TypeDefinition typeDef, LinkedList<Element> stack) { if (findTypeDefinition(typeDef) == null && !isKnownType(typeDef)) { this.typeDefinitions.put(typeDef.getQualifiedName().toString(), typeDef);
public void add(TypeDefinition typeDef, LinkedList<Element> stack) { if (findTypeDefinition(typeDef) == null && !isKnownType(typeDef)) { this.typeDefinitions.put(typeDef.getQualifiedName().toString(), typeDef);
TypeDefinition typeDefinition = context.getContext().findTypeDefinition(declaredElement); if (typeDefinition != null) { jsonType = new JsonClassType(typeDefinition);
TypeDefinition typeDefinition = context.getContext().findTypeDefinition(declaredElement); if (typeDefinition != null) { jsonType = new JsonClassType(typeDefinition);