|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.metadata.ClassDescriptor
public class ClassDescriptor
Describe a business model class. Gives access to attribute, reference and collection descriptors. Includes primary key information.
| Field Summary | |
|---|---|
protected static java.lang.String |
ENDL
|
| Constructor Summary | |
|---|---|
ClassDescriptor(java.lang.String name,
java.lang.String supers,
boolean isInterface,
java.util.Set<AttributeDescriptor> atts,
java.util.Set<ReferenceDescriptor> refs,
java.util.Set<CollectionDescriptor> cols)
Construct a ClassDescriptor. |
|
| Method Summary | |
|---|---|
int |
compareTo(ClassDescriptor cld)
|
boolean |
equals(java.lang.Object obj)
|
static java.util.Set<java.lang.String> |
findSuperClassNames(Model model,
java.lang.String className)
Return a list of the super class names for the given class name. |
java.util.Set<AttributeDescriptor> |
getAllAttributeDescriptors()
Gets all AttributeDescriptors for this class and its super classes - i.e. fields that are not references or collections. |
java.util.Set<CollectionDescriptor> |
getAllCollectionDescriptors()
Gets all CollectionDescriptors for this class - i.e. including those from superclass. |
java.util.Set<FieldDescriptor> |
getAllFieldDescriptors()
Gets the FieldDescriptors for this class and all superclasses and interfaces. |
java.util.Set<ReferenceDescriptor> |
getAllReferenceDescriptors()
Gets all ReferenceDescriptors for this class - i.e. including those from superclass. |
AttributeDescriptor |
getAttributeDescriptorByName(java.lang.String name)
Gets an AttributeDescriptor for a field of the given name. |
AttributeDescriptor |
getAttributeDescriptorByName(java.lang.String name,
boolean ascend)
Gets an AttributeDescriptor for a field of the given name. |
java.util.Set<AttributeDescriptor> |
getAttributeDescriptors()
Gets AttributeDescriptors for this class - i.e. fields that are not references or collections. |
CollectionDescriptor |
getCollectionDescriptorByName(java.lang.String name)
Gets a CollectionDescriptor for a collection of the given name. |
CollectionDescriptor |
getCollectionDescriptorByName(java.lang.String name,
boolean ascend)
Gets a CollectionDescriptor for a field of the given name. |
java.util.Set<CollectionDescriptor> |
getCollectionDescriptors()
Gets CollectionDescriptors for this class. |
FieldDescriptor |
getFieldDescriptorByName(java.lang.String name)
Retrieve a FieldDescriptor by name. |
java.util.Set<FieldDescriptor> |
getFieldDescriptors()
Gets the FieldDescriptors for this class (but not superclasses). |
java.lang.String |
getHumanReadableText()
Returns a String that contains a multi-line human-readable description of the ClassDescriptor. |
Model |
getModel()
Return the model this class is a part of. |
java.lang.String |
getName()
Returns the fully qualified class name described by this ClassDescriptor. |
ReferenceDescriptor |
getReferenceDescriptorByName(java.lang.String name)
Gets a ReferenceDescriptor for a field of the given name. |
ReferenceDescriptor |
getReferenceDescriptorByName(java.lang.String name,
boolean ascend)
Gets a ReferenceDescriptor for a field of the given name. |
java.util.Set<ReferenceDescriptor> |
getReferenceDescriptors()
Gets the descriptors for the external object references in this class. |
java.util.Set<ClassDescriptor> |
getSubDescriptors()
Return a Set of ClassDescriptors for all classes that directly extend or implement this class or interface. |
ClassDescriptor |
getSuperclassDescriptor()
Get the name of the super class of this class (may be null). |
java.util.Set<java.lang.String> |
getSuperclassNames()
Return set of superclass class names. |
java.util.Set<ClassDescriptor> |
getSuperDescriptors()
Get a set of ClassDescriptors for the interfaces superclasses that this class implements. |
java.lang.Class<? extends FastPathObject> |
getType()
Returns the Class described by this ClassDescriptor. |
java.lang.String |
getUnqualifiedName()
Returns unqualified name of class described by this ClassDescriptor. |
int |
hashCode()
|
boolean |
isInterface()
True if this class is an interface. |
protected void |
setAllFieldDescriptors()
Sets up the object a little. |
protected void |
setModel(Model model)
Set the model for this ClassDescriptor, this is only be called once and will throw an Exception if called again. |
static java.lang.String |
terseClass(java.lang.String c)
Strips everything before the last dot out of a String. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String ENDL
| Constructor Detail |
|---|
public ClassDescriptor(java.lang.String name,
java.lang.String supers,
boolean isInterface,
java.util.Set<AttributeDescriptor> atts,
java.util.Set<ReferenceDescriptor> refs,
java.util.Set<CollectionDescriptor> cols)
name - the fully qualified name of the described classsupers - a space string of fully qualified interface and superclass namesisInterface - true if describing an interfaceatts - a Collection of AttributeDescriptorsrefs - a Collection of ReferenceDescriptorscols - a Collection of CollectionDescriptors
java.lang.IllegalArgumentException - if fields are null| Method Detail |
|---|
public java.lang.String getName()
public java.lang.Class<? extends FastPathObject> getType()
public java.util.Set<java.lang.String> getSuperclassNames()
public java.lang.String getUnqualifiedName()
public java.util.Set<FieldDescriptor> getFieldDescriptors()
public java.util.Set<FieldDescriptor> getAllFieldDescriptors()
protected void setAllFieldDescriptors()
throws MetaDataException
MetaDataException - if something goes wrongpublic FieldDescriptor getFieldDescriptorByName(java.lang.String name)
name - the name
public java.util.Set<AttributeDescriptor> getAttributeDescriptors()
public java.util.Set<AttributeDescriptor> getAllAttributeDescriptors()
public java.util.Set<ReferenceDescriptor> getReferenceDescriptors()
public java.util.Set<ReferenceDescriptor> getAllReferenceDescriptors()
public ReferenceDescriptor getReferenceDescriptorByName(java.lang.String name)
name - the name of a ReferenceDescriptor to find
public ReferenceDescriptor getReferenceDescriptorByName(java.lang.String name,
boolean ascend)
name - the name of a ReferenceDescriptor to findascend - if true search in super class hierarchy
public AttributeDescriptor getAttributeDescriptorByName(java.lang.String name)
name - the name of an AttributeDescriptor to find
public AttributeDescriptor getAttributeDescriptorByName(java.lang.String name,
boolean ascend)
name - the name of an AttributeDescriptor to findascend - if true search in super class hierarchy
public java.util.Set<CollectionDescriptor> getAllCollectionDescriptors()
public java.util.Set<CollectionDescriptor> getCollectionDescriptors()
public CollectionDescriptor getCollectionDescriptorByName(java.lang.String name)
name - the name of a CollectionDescriptor to find
public CollectionDescriptor getCollectionDescriptorByName(java.lang.String name,
boolean ascend)
name - the name of an CollectionDescriptor to findascend - if true search in super class hierarchy
public ClassDescriptor getSuperclassDescriptor()
java.lang.IllegalStateException - if model not setpublic java.util.Set<ClassDescriptor> getSuperDescriptors()
java.lang.IllegalStateException - if the model is not setpublic boolean isInterface()
public java.util.Set<ClassDescriptor> getSubDescriptors()
java.lang.IllegalStateException - if the set of subclasses has not been set
protected void setModel(Model model)
throws MetaDataException
model - the parent model for this ClassDescriptor
java.lang.IllegalStateException - if the model is already set
MetaDataException - if references not found
public static java.util.Set<java.lang.String> findSuperClassNames(Model model,
java.lang.String className)
throws MetaDataException
model - the ModelclassName - the className
MetaDataException - if className isn't in the modelpublic Model getModel()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(ClassDescriptor cld)
compareTo in interface java.lang.Comparable<ClassDescriptor>public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getHumanReadableText()
public static java.lang.String terseClass(java.lang.String c)
c - a String
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||