|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tv.amwa.maj.industry.ClassDefinitionWarehouse
public final class ClassDefinitionWarehouse
Stores and provides access to class definitions, dynamically linking them to the underlying implementation if they are not yet known. If a fully specified class name is used to point to a class annotated as a AAF class, the set of classes supported by the API can be dynamically extended at runtime.
This class maintains an internal runtime cache of previously seen class definitions so that a runtime environment should have exactly one class definition per class in use.
ClassDefinition
,
AAFClass
,
AAFFactory.classDefinitionForName(java.lang.String)
,
AAFFactory.classDefinitionForClass(java.lang.Class)
,
makeClassDefinition()
Method Summary | |
---|---|
static ClassDefinition |
forClass(Class<?> aafClass)
For any given Java class, this method finds the corresponding AAF class definition or creates it if it does not yet exists within the current Java virtual machine. |
static ClassDefinition |
forName(String name)
Finds and returns a class definition for the given AAF class name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final ClassDefinition forClass(Class<?> aafClass) throws NullPointerException, IllegalArgumentException
For any given Java class, this method finds the corresponding AAF class definition or creates it if it does not yet exists within the current Java virtual machine. The creation of class definitions is done by lazy evaluation as required using Java reflection and annotations. All generated values are cached in a local, static hashtable so that once generated, the work is not repeated.
The values returned by this method are only as good as the annotations provided with
the sourcecode, as labelled using AAFClass
and AAFProperty
.
If an AAFClass
annotation is not present in the given class, an IllegalArgumentException
is thrown. Any
problems found with the AAFProperty
annotations, such as two properties having the same
name, will also result in an IllegalArgumentException
.
aafClass
- Java class to find the AAF class definition of.
NullPointerException
- Argument is null.
IllegalArgumentException
- The given Java class is not annotated with AAFClass
or
the AAFProperty
annotations contain errors.AAFClass
,
AAFProperty
,
AAFFactory.classDefinitionForClass(java.lang.Class)
,
ClassDefinition.forClass(java.lang.Class)
public static final ClassDefinition forName(String name) throws NullPointerException, IllegalArgumentException
Finds and returns a class definition for the given AAF class name. Firstly, the search takes place using the class name specified in the AAF object specification and then by using a Java class name.
The search order used by this method is:
Class.forName(String)
followed by
AAFFactory.classDefinitionForClass(Class)
with the result. Return the value.Class.forName(String)
followed by
AAFFactory.classDefinitionForClass(Class)
with the result. Return the value.Once the class has been located and linked into the running virtual machine, the forClass(Class)
method is called.
name
- Name of the class definition to find, specified using a name from the AAF object specification,
a MAJ API class name or a fully qualified java class name.
NullPointerException
- The given class name is null
.
IllegalArgumentException
- The given class name could not be resolved to an AAF class.Class.forName(java.lang.String)
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |