Package org.apache.xmlgraphics.xmp
Class XMPProperty
- java.lang.Object
-
- org.apache.xmlgraphics.xmp.XMPProperty
-
-
Constructor Summary
Constructors Constructor Description XMPProperty(QName name, java.lang.Object value)Creates a new XMP property.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XMPArrayconvertSimpleValueToArray(XMPArrayType type)Converts a simple value to an array of a given type if the value is not already an array.XMPArraygetArrayValue()QNamegetName()java.lang.StringgetNamespace()PropertyAccessgetStructureValue()java.lang.ObjectgetValue()java.lang.StringgetXMLLang()booleanisArray()Indicates whether the property is an array.booleanisQualifiedProperty()Indicates whether this property is actually not a structure, but a normal property with property qualifiers.voidsetValue(java.lang.Object value)Sets the value of the propertyvoidsetXMLLang(java.lang.String lang)Sets the xml:lang value for this propertyvoidsimplify()voidtoSAX(org.xml.sax.ContentHandler handler)Generates SAX events representing the object's state.java.lang.StringtoString()
-
-
-
Constructor Detail
-
XMPProperty
public XMPProperty(QName name, java.lang.Object value)
Creates a new XMP property.- Parameters:
name- the name of the propertyvalue- the value for the property
-
-
Method Detail
-
getName
public QName getName()
- Returns:
- the qualified name of the property (namespace URI + local name)
-
getNamespace
public java.lang.String getNamespace()
- Returns:
- the namespace URI of the property
-
setValue
public void setValue(java.lang.Object value)
Sets the value of the property- Parameters:
value- the new value
-
getValue
public java.lang.Object getValue()
- Returns:
- the property value (can be a normal Java object (normally a String) or a descendant of XMPComplexValue.
-
setXMLLang
public void setXMLLang(java.lang.String lang)
Sets the xml:lang value for this property- Parameters:
lang- the language ("x-default" for the default language, null to make the value language-independent)
-
getXMLLang
public java.lang.String getXMLLang()
- Returns:
- the language for language-dependent values ("x-default" for the default language)
-
isArray
public boolean isArray()
Indicates whether the property is an array.- Returns:
- true if the property is an array
-
getArrayValue
public XMPArray getArrayValue()
- Returns:
- the XMPArray for an array or null if the value is not an array.
-
convertSimpleValueToArray
public XMPArray convertSimpleValueToArray(XMPArrayType type)
Converts a simple value to an array of a given type if the value is not already an array.- Parameters:
type- the desired type of array- Returns:
- the array value
-
getStructureValue
public PropertyAccess getStructureValue()
- Returns:
- the XMPStructure for a structure or null if the value is not a structure.
-
isQualifiedProperty
public boolean isQualifiedProperty()
Indicates whether this property is actually not a structure, but a normal property with property qualifiers. If this method returns true, this structure can be converted to an simple XMPProperty using the simplify() method.- Returns:
- true if this property is a structure property with property qualifiers
-
simplify
public void simplify()
-
toSAX
public void toSAX(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLizableGenerates SAX events representing the object's state.- Specified by:
toSAXin interfaceXMLizable- Parameters:
handler- ContentHandler instance to send the SAX events to- Throws:
org.xml.sax.SAXException- if there's a problem generating the SAX events- See Also:
XMLizable.toSAX(org.xml.sax.ContentHandler)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-