public AbstractClassTypeDeclarationDescr(final String typeName, final String typeNamespace) { this.type = new QualifiedName( typeName, typeNamespace ); }
public String toString() { return getFullName(); } }
/** * @return the identifier */ public String getTypeName() { return this.type.getName(); }
String declaredSuperType = qname.getFullName(); this.results.add( new TypeDeclarationError( typeDescr, "Cannot resolve supertype '" + declaredSuperType + "'") ); qname.setName( null ); qname.setNamespace( null ); } else { qname.setName( declaredSuperType.substring( separator + 1 ) ); qname.setNamespace( declaredSuperType.substring( 0, separator ) );
String simpleSuperTypeName = qname.getName(); String superTypePackageName = qname.getNamespace(); String fullSuper = qname.getFullName();
if ( ! Object.class.getName().equals( name.getFullName() ) ) { if ( ! hasCircularDependency( tdescr.getType(), sup, taxonomy ) ) { supers.add( sup ); QualifiedName typeName = new QualifiedName( field.getPattern().getObjectType() ); if ( ! hasCircularDependency( name, typeName, taxonomy ) ) { supers.add( typeName );
for ( AbstractClassTypeDeclarationDescr typeDescr : packageDescr.getClassAndEnumDeclarationDescrs() ) { String qName = typeDescr.getType().getFullName(); Class typeClass = getClassForType(qName); if (typeClass == null) { if (tail.equals( typeDescr.getTypeName() )) { typeDescr.setNamespace( imp.substring( 0, separator ) ); typeClass = getClassForType(typeDescr.getType().getFullName()); break; if (qname.equals(descr.getType())) { typeDescr.getAnnotations().putAll(descr.getAnnotations()); break; } else if (typeDescr.getType().equals(descr.getType())) { break; unresolvedTypeDefinitions ); Class clazz = pkgRegistry.getTypeResolver().resolveType(typeDescr.getType().getFullName()); type.setTypeClass( clazz );
private boolean hasCircularDependency( QualifiedName name, QualifiedName typeName, Map<QualifiedName, Collection<QualifiedName>> taxonomy) { if ( name.equals( typeName ) ) { return true; } if ( taxonomy.containsKey( typeName ) ) { Collection<QualifiedName> parents = taxonomy.get( typeName ); if ( parents.contains( name ) ) { return true; } else { for ( QualifiedName ancestor : parents ) { if ( hasCircularDependency( name, ancestor, taxonomy ) ) { return true; } } } } return false; }
public String getSuperTypeNamespace() { return superTypes == null ? null : superTypes.get(0).getNamespace(); }
/** * @param typeName the identifier to set */ public void setTypeName( String typeName ) { if ( typeName.indexOf( '.' ) < 0 ) { this.type.setName( typeName ); } else { this.setNamespace( typeName.substring( 0, typeName.lastIndexOf( '.' ) ) ); this.type.setName( typeName.substring( typeName.lastIndexOf( '.' ) + 1 ) ); } }
public void setNamespace( String namespace ) { super.setNamespace(namespace); this.type.setNamespace(namespace); }
public int hashCode() { return getType() != null ? getType() .hashCode() : 0; } }
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AbstractClassTypeDeclarationDescr that = (AbstractClassTypeDeclarationDescr) o; return !(getType() != null ? !getType().equals(that.getType()) : that.getType() != null); }
void registerGeneratedType(AbstractClassTypeDeclarationDescr typeDescr) { String fullName = typeDescr.getType().getFullName(); generatedTypes.add( fullName ); }
public void setType( String name, String namespace ) { type = new QualifiedName( name, namespace ); }
public String getSuperTypeName() { return superTypes == null ? null : superTypes.get(0).getName(); }
public String toString() { return "EnumDeclaration[ " + this.getType().getFullName() + " ]"; }
public AbstractClassTypeDeclarationDescr( String name ) { this.type = new QualifiedName( name, null ); }
public String toString() { return "TypeDeclaration[ " + this.getType().getFullName() + " ]"; }
public List<QualifiedName> getSuperTypes() { List<QualifiedName> l = new ArrayList<QualifiedName>( 1 ); l.add( new QualifiedName( "Object", "java.lang" ) ); return l; }