|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.metadata.Model
public class Model
Represents a named business model, makes available metadata for each class within model.
| Field Summary | |
|---|---|
protected static java.lang.String |
ENDL
|
| Constructor Summary | |
|---|---|
Model(java.lang.String name,
java.lang.String packageName,
java.util.Set<ClassDescriptor> clds)
Construct a Model with a name and set of ClassDescriptors. |
|
| Method Summary | |
|---|---|
static void |
addModel(java.lang.String name,
Model model)
Adds model to known models. |
boolean |
equals(java.lang.Object obj)
|
java.util.Set<ClassDescriptor> |
getAllSubs(ClassDescriptor cld)
Get the ClassDescriptors for the all subclasses of a class |
ClassDescriptor |
getClassDescriptorByName(java.lang.String name)
Get a ClassDescriptor by name, null if no ClassDescriptor of given name in Model. |
java.util.Set<ClassDescriptor> |
getClassDescriptors()
Get all ClassDescriptors in this model. |
java.util.Set<ClassDescriptor> |
getClassDescriptorsForClass(java.lang.Class<?> c)
Takes a Class, and generates a Set of all ClassDescriptors that are the Class or any of its parents. |
java.util.Set<java.lang.String> |
getClassNames()
Get a Set of fully qualified class names in this model (i.e. including package name). |
java.util.Map<java.lang.String,java.lang.Class<?>> |
getCollectionsForClass(java.lang.Class<?> c)
Takes a Class, and generates a Map of all the collections that are in the Class or any of its parents. |
java.util.Set<ClassDescriptor> |
getDirectSubs(ClassDescriptor cld)
Get the ClassDescriptors for the direct subclasses of a class |
java.util.Map<java.lang.String,FieldDescriptor> |
getFieldDescriptorsForClass(java.lang.Class<?> c)
Takes a Class, and generates a Map of all FieldDescriptors that are the class fields or any of its parents. |
static Model |
getInstanceByName(java.lang.String name)
Return a Model for specified model name (loading Model if necessary) |
java.lang.String |
getName()
Get the name of this model - i.e. package name. |
java.lang.String |
getPackageName()
Return name of the model's package. |
java.lang.String |
getQualifiedTypeName(java.lang.String className)
Return the qualified name of the given unqualified class name. |
boolean |
hasClassDescriptor(java.lang.String name)
Return true if named ClassDescriptor is found in the model. |
int |
hashCode()
|
boolean |
isGeneratedClassAvailable(java.lang.String className)
|
boolean |
isGeneratedClassesAvailable()
|
void |
setGeneratedClassesAvailable(boolean available)
Sets if generated classes are available. |
java.lang.String |
toAdditionsXML()
Used to generate the SO additions file |
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 Model(java.lang.String name,
java.lang.String packageName,
java.util.Set<ClassDescriptor> clds)
throws MetaDataException
name - name of modelpackageName - the package name of the modelclds - a Set of ClassDescriptors in the model
MetaDataException - if inconsistencies found in model| Method Detail |
|---|
public static Model getInstanceByName(java.lang.String name)
name - the name of the model
public static void addModel(java.lang.String name,
Model model)
name - the model namemodel - the modelpublic java.lang.String getPackageName()
public java.util.Set<ClassDescriptor> getDirectSubs(ClassDescriptor cld)
cld - the parent ClassDescriptor
public java.util.Set<ClassDescriptor> getAllSubs(ClassDescriptor cld)
cld - the parent ClassDescriptor
public ClassDescriptor getClassDescriptorByName(java.lang.String name)
name - unqualified or fully-qualified class name of ClassDescriptor requested
public java.util.Set<ClassDescriptor> getClassDescriptors()
public boolean hasClassDescriptor(java.lang.String name)
name - named of ClassDescriptor search for
public java.util.Set<java.lang.String> getClassNames()
public java.lang.String getName()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toAdditionsXML()
public java.util.Set<ClassDescriptor> getClassDescriptorsForClass(java.lang.Class<?> c)
c - a Class
public java.util.Map<java.lang.String,FieldDescriptor> getFieldDescriptorsForClass(java.lang.Class<?> c)
c - a Class
public java.util.Map<java.lang.String,java.lang.Class<?>> getCollectionsForClass(java.lang.Class<?> c)
c - a Class
public java.lang.String getQualifiedTypeName(java.lang.String className)
throws java.lang.ClassNotFoundException
className - the name of the class
java.lang.ClassNotFoundException - if the class can't be foundpublic boolean isGeneratedClassesAvailable()
public void setGeneratedClassesAvailable(boolean available)
available - if generated class is availablepublic boolean isGeneratedClassAvailable(java.lang.String className)
className - class name
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||