|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttv.amwa.maj.meta.MetaDefinition
tv.amwa.maj.meta.TypeDefinition
tv.amwa.maj.meta.TypeDefinitionObjectReference
public abstract class TypeDefinitionObjectReference
Implements the definition of a property type that defines an object relationship.
Nested Class Summary | |
---|---|
static class |
TypeDefinitionObjectReference.ObjectReferenceValue
|
static class |
TypeDefinitionObjectReference.TypeDefinitionObjectReferenceUnresolved
|
Constructor Summary | |
---|---|
TypeDefinitionObjectReference()
|
Method Summary | |
---|---|
void |
appendXMLChildren(Node parent)
Append child elements to the given parent node to serialize the value of an object to an XML fragment. |
PropertyValue |
createValue(Object object)
Create a property value from the given Java object. |
boolean |
deepEquals(Object o)
Check to see if this definition is equal to the given object by comparing each property. |
Object |
getObject(PropertyValue propertyValue)
Returns the object referenced by the given object reference property value. |
ClassDefinition |
getObjectType()
Returns the class definition representing the class of objects to which this object reference type definition can refer. |
void |
setObject(PropertyValue propertyValue,
Object object)
Sets the given object as the target of the given object reference property value. |
void |
setPropertiesFromInterface(TypeDefinitionObjectReference castFrom)
|
Methods inherited from class tv.amwa.maj.meta.TypeDefinition |
---|
getTypeCategory, setPropertiesFromInterface |
Methods inherited from class tv.amwa.maj.meta.MetaDefinition |
---|
castFromInterface, equals, getAUID, getDescription, getIdentification, getName, hashCode, setDescription, setName, setPropertiesFromInterface, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface tv.amwa.maj.iface.TypeDefinition |
---|
getTypeCategory |
Methods inherited from interface tv.amwa.maj.iface.MetaDefinition |
---|
getAUID, getDescription, getName, setDescription, setName |
Methods inherited from interface tv.amwa.maj.meta.MAJCommon |
---|
equals, hashCode, toString |
Constructor Detail |
---|
public TypeDefinitionObjectReference()
Method Detail |
---|
public final void setPropertiesFromInterface(TypeDefinitionObjectReference castFrom)
MetaDefinition.setPropertiesFromInterface(tv.amwa.maj.iface.MetaDefinition)
public PropertyValue createValue(Object object) throws ClassCastException
TypeDefinition
Create a property value from the given Java object. If the type of
the object is not compatible with this type definition, a ClassCastException
is thrown.
createValue
in interface TypeDefinition
createValue
in interface TypeDefinitionObjectReference
createValue
in class TypeDefinition
object
- Java object to use to create a property value of this type.
ClassCastException
- The given object cannot be cast to a property value with
this type definition.TypeDefinitionObjectReference.setObject(PropertyValue, Object)
public Object getObject(PropertyValue propertyValue) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionObjectReference
Returns the object referenced by the given object reference property value.
getObject
in interface TypeDefinitionObjectReference
propertyValue
- Property value form which the value is to
be read.
NullPointerException
- The given property value containing
a reference is null
.
IllegalPropertyValueException
- The given property value is
not defined by this object reference type.public ClassDefinition getObjectType()
TypeDefinitionObjectReference
Returns the class definition representing the class of objects to which this object reference type definition can refer. The returned definition is the least-derived type that it is permissible to represent, in other words the type definition can represent objects of the given class and any of its sub-classes.
getObjectType
in interface TypeDefinitionObjectReference
public void setObject(PropertyValue propertyValue, Object object) throws NullPointerException, IllegalPropertyValueException, ClassCastException
TypeDefinitionObjectReference
Sets the given object as the target of the given object reference property value.
setObject
in interface TypeDefinitionObjectReference
propertyValue
- Property value containing the object
reference to be set.object
- Target of the object reference to set for the
given property value.
NullPointerException
- Argument is null.
IllegalPropertyValueException
- The given property value is
not defined by this object reference type.
ClassCastException
- The given object cannot be cast
to one compatible with the permissible classes, as returned
by TypeDefinitionObjectReference.getObjectType()
.TypeDefinitionObjectReference.createValue(Object)
public boolean deepEquals(Object o)
MetaDefinition
Check to see if this definition is equal to the given object by comparing each
property. The MetaDefinition.equals(Object)
method only checks that the identies of two
definitions are equal, relying on the unqiueness ensured by identity registration.
This method is provided for debugging and validation purposes.
deepEquals
in class MetaDefinition
o
- Object to compare to this definition.
public void appendXMLChildren(Node parent)
XMLSerializable
Append child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder
class are provided to help with this
process.
appendXMLChildren
in interface XMLSerializable
appendXMLChildren
in class MetaDefinition
parent
- XML parent element to append child nodes to.
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |