public void visitArrayType(ArrayType arrayType) { if (isInArray) { this.xmlType = null; this.errorMessage = "No support yet for multidimensional arrays."; return; } arrayType.getComponentType().accept(this); if (this.errorMessage != null) { this.errorMessage = "Problem with the array component type: " + this.errorMessage; } }
public void accept(TypeVisitor typeVisitor) { delegate.accept(typeVisitor); }
public Kind getKind() { return ((PrimitiveType)delegate).getKind(); }
public TypeMirror getComponentType(TypeMirror t) { if (t instanceof ArrayType) { ArrayType at = (ArrayType) t; return at.getComponentType(); } throw new IllegalArgumentException(); }
public boolean isParameterizedType(TypeMirror t) { if (t instanceof DeclaredType) { DeclaredType d = (DeclaredType) t; return !d.getActualTypeArguments().isEmpty(); } return false; }
public void visitWildcardType(WildcardType wildcardType) { Iterator<ReferenceType> upperBounds = wildcardType.getUpperBounds().iterator(); if (!upperBounds.hasNext()) { this.xmlType = KnownXmlType.ANY_TYPE; } else { upperBounds.next().accept(this); if (this.errorMessage != null) { this.errorMessage = "Problem with wildcard bounds: " + this.errorMessage; } } }
public void visitTypeVariable(TypeVariable typeVariable) { TypeParameterDeclaration declaration = typeVariable.getDeclaration(); if (declaration != null) { Collection<ReferenceType> bounds = declaration.getBounds(); for (ReferenceType referenceType : bounds) { referenceType.accept(this); } } } };
public TypeMirror onClassType(ClassType type, TypeDeclaration sup) { TypeMirror r = onDeclaredType(type,sup); if(r!=null) return r; // otherwise recursively apply super class and base types if(type.getSuperclass()!=null) { r = onClassType(type.getSuperclass(),sup); if(r!=null) return r; } return null; }
public void visitEnumType(EnumType enumType) { EnumDeclaration enumDeclaration = enumType.getDeclaration(); if (enumDeclaration != null) { add(createTypeDefinition(enumDeclaration)); } } }
public void visitArrayType(ArrayType arrayType) { if (isInArray) { this.xmlType = null; this.errorMessage = "No support yet for multidimensional arrays."; return; } arrayType.getComponentType().accept(this); if (this.errorMessage != null) { this.errorMessage = "Problem with the array component type: " + this.errorMessage; } }
public void visitWildcardType(WildcardType wildcardType) { Iterator<ReferenceType> upperBounds = wildcardType.getUpperBounds().iterator(); if (upperBounds.hasNext()) { upperBounds.next().accept(this); } } }
public void visitTypeVariable(TypeVariable typeVariable) { Iterator<ReferenceType> bounds = typeVariable.getDeclaration().getBounds().iterator(); if (!bounds.hasNext()) { this.xmlType = KnownXmlType.ANY_TYPE; } else { bounds.next().accept(this); if (this.errorMessage != null) { this.errorMessage = "Problem with the type variable bounds: " + this.errorMessage; } } }
public void visitPrimitiveType(PrimitiveType primitiveType) { if (isInArray && (primitiveType.getKind() == PrimitiveType.Kind.BYTE)) { //special case for byte[] this.xmlType = KnownXmlType.BASE64_BINARY; } else { this.xmlType = new XmlPrimitiveType(primitiveType); } }
public void accept(TypeVisitor typeVisitor) { delegate.accept(typeVisitor); }
@Override public void visitArrayType(ArrayType arrayType) { arrayType.getComponentType().accept(this); fqn[0] += "[]"; } });
public void visitWildcardType(WildcardType wildcardType) { Iterator<ReferenceType> upperBounds = wildcardType.getUpperBounds().iterator(); if (!upperBounds.hasNext()) { this.xmlType = KnownXmlType.ANY_TYPE; } else { upperBounds.next().accept(this); if (this.errorMessage != null) { this.errorMessage = "Problem with wildcard bounds: " + this.errorMessage; } } }
/** * Adds any referenced type definitions for the specified type mirror. * * @param type The type mirror. */ protected void addReferencedTypeDefinitions(TypeMirror type) { type.accept(new ReferencedXmlTypeDefinitionVisitor()); }
public void visitArrayType(ArrayType arrayType) { arrayType.getComponentType().accept(this); }
/** * Adds any referenced type definitions for the specified type mirror. * * @param type The type mirror. */ protected void addReferencedJsonTypeDefinitions(TypeMirror type) { type.accept(new ReferencedJsonTypeDefinitionVisitor()); }
public void visitArrayType(ArrayType arrayType) { arrayType.getComponentType().accept(this); }