|
xmlgraphics-commons 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xmlgraphics.xmp.XMPSchemaAdapter
public class XMPSchemaAdapter
Base class for schema-specific adapters that provide user-friendly access to XMP values.
Field Summary | |
---|---|
protected Metadata |
meta
the Metadata object this schema instance operates on |
Constructor Summary | |
---|---|
XMPSchemaAdapter(Metadata meta,
XMPSchema schema)
Main constructor. |
Method Summary | |
---|---|
protected void |
addDateToSeq(String propName,
Date value)
Adds a date value to an ordered array. |
protected void |
addObjectToArray(String propName,
Object value,
XMPArrayType arrayType)
Adds a Object value to an array. |
protected void |
addStringToBag(String propName,
String value)
Adds a String value to an unordered array. |
protected void |
addStringToSeq(String propName,
String value)
Adds a String value to an ordered array. |
protected PropertyAccess |
findQualifiedStructure(String propName,
QName qualifier,
String qualifierValue)
Finds a structure that matches a given qualifier. |
protected Object |
findQualifiedValue(String propName,
QName qualifier,
String qualifierValue)
Finds a value that matches a given qualifier. |
static String |
formatISO8601Date(Date dt)
Formats a Date using ISO 8601 format in the default time zone. |
static String |
formatISO8601Date(Date dt,
TimeZone tz)
Formats a Date using ISO 8601 format in the given time zone. |
protected Date[] |
getDateArray(String propName)
Returns a Date array representation of the property's values. |
protected Date |
getDateValue(String propName)
Returns a date value. |
protected String |
getLangAlt(String lang,
String propName)
Returns a language-dependent value. |
protected Object[] |
getObjectArray(String propName)
Returns an object array representation of the property's values. |
protected QName |
getQName(String propName)
Returns the QName for a given property |
XMPSchema |
getSchema()
|
protected String[] |
getStringArray(String propName)
Returns a String array representation of the property's values. |
protected String |
getValue(String propName)
Returns a simple value. |
protected String |
removeLangAlt(String lang,
String propName)
Removes a language-dependent value from an alternative array. |
protected boolean |
removeStringFromArray(String propName,
String value)
Removes a value from an array. |
void |
setCompact(boolean c)
|
protected void |
setDateValue(String propName,
Date value)
Set a date value. |
protected void |
setLangAlt(String propName,
String lang,
String value)
Sets a language-dependent value. |
protected void |
setValue(String propName,
String value)
Sets a simple value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Metadata meta
Constructor Detail |
---|
public XMPSchemaAdapter(Metadata meta, XMPSchema schema)
meta
- the Metadata object to wraoschema
- the XMP schema for which this adapter was writtenMethod Detail |
---|
public XMPSchema getSchema()
protected QName getQName(String propName)
propName
- the property name
protected void addObjectToArray(String propName, Object value, XMPArrayType arrayType)
propName
- the property namevalue
- the Object valuearrayType
- the type of array to operate onprotected boolean removeStringFromArray(String propName, String value)
propName
- the name of the propertyvalue
- the value to be removed
protected void addStringToSeq(String propName, String value)
propName
- the property namevalue
- the String valueprotected void addStringToBag(String propName, String value)
propName
- the property namevalue
- the String valuepublic static String formatISO8601Date(Date dt)
dt
- the date
public static String formatISO8601Date(Date dt, TimeZone tz)
dt
- the datetz
- the time zone
protected void addDateToSeq(String propName, Date value)
propName
- the property namevalue
- the date valueprotected void setDateValue(String propName, Date value)
propName
- the property namevalue
- the date valueprotected Date getDateValue(String propName)
propName
- the property name
protected void setLangAlt(String propName, String lang, String value)
propName
- the property namelang
- the language ("x-default" or null for the default language)value
- the valueprotected void setValue(String propName, String value)
propName
- the property namevalue
- the valueprotected String getValue(String propName)
propName
- the property name
protected String removeLangAlt(String lang, String propName)
lang
- the language ("x-default" for the default language)propName
- the property name
protected String getLangAlt(String lang, String propName)
lang
- the language ("x-default" for the default language)propName
- the property name
protected PropertyAccess findQualifiedStructure(String propName, QName qualifier, String qualifierValue)
propName
- the property namequalifier
- the qualifierqualifierValue
- the qualifier value
protected Object findQualifiedValue(String propName, QName qualifier, String qualifierValue)
propName
- the property namequalifier
- the qualifierqualifierValue
- the qualifier value
protected Object[] getObjectArray(String propName)
propName
- the property name
protected String[] getStringArray(String propName)
propName
- the property name
protected Date[] getDateArray(String propName)
propName
- the property name
public void setCompact(boolean c)
|
xmlgraphics-commons 2.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |