Package org.apache.xmlgraphics.xmp
Class XMPProperty
java.lang.Object
org.apache.xmlgraphics.xmp.XMPProperty
- All Implemented Interfaces:
XMLizable
This class is the base class for all XMP properties.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts a simple value to an array of a given type if the value is not already an array.getName()
getValue()
boolean
isArray()
Indicates whether the property is an array.boolean
Indicates whether this property is actually not a structure, but a normal property with property qualifiers.void
Sets the value of the propertyvoid
setXMLLang
(String lang) Sets the xml:lang value for this propertyvoid
simplify()
void
toSAX
(ContentHandler handler) Generates SAX events representing the object's state.toString()
-
Field Details
-
attribute
protected boolean attribute
-
-
Constructor Details
-
XMPProperty
Creates a new XMP property.- Parameters:
name
- the name of the propertyvalue
- the value for the property
-
-
Method Details
-
getName
- Returns:
- the qualified name of the property (namespace URI + local name)
-
getNamespace
- Returns:
- the namespace URI of the property
-
setValue
Sets the value of the property- Parameters:
value
- the new value
-
getValue
- Returns:
- the property value (can be a normal Java object (normally a String) or a descendant of XMPComplexValue.
-
setXMLLang
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
- 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
- Returns:
- the XMPArray for an array or null if the value is not an array.
-
convertSimpleValueToArray
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
- 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
Description copied from interface:XMLizable
Generates SAX events representing the object's state.- Specified by:
toSAX
in interfaceXMLizable
- Parameters:
handler
- ContentHandler instance to send the SAX events to- Throws:
SAXException
- if there's a problem generating the SAX events- See Also:
-
toString
-