Package com.adobe.xmp.options
Class PropertyOptions
- java.lang.Object
-
- com.adobe.xmp.options.Options
-
- com.adobe.xmp.options.PropertyOptions
-
public final class PropertyOptions extends Options
The property flags are used when properties are fetched from theXMPMeta-object and provide more detailed information about the property.- Since:
- 03.07.2006
-
-
Field Summary
Fields Modifier and Type Field Description static intARRAYstatic intARRAY_ALT_TEXTstatic intARRAY_ALTERNATEstatic intARRAY_ORDEREDstatic intCOMPACTstatic intDELETE_EXISTINGmay be used in the futurestatic intHAS_LANGUAGEstatic intHAS_QUALIFIERSstatic intHAS_TYPEstatic intNO_OPTIONSstatic intQUALIFIERstatic intSCHEMA_NODEstatic intSTRUCTstatic intURI
-
Constructor Summary
Constructors Constructor Description PropertyOptions()Default constructorPropertyOptions(int options)Intialization constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertConsistency(int options)Checks that a node not a struct and array at the same time; and URI cannot be a struct.booleanequalArrayTypes(PropertyOptions options)Compares two options set for array compatibility.booleangetHasLanguage()booleangetHasQualifiers()booleangetHasType()booleanisArray()booleanisArrayAlternate()booleanisArrayAltText()booleanisArrayOrdered()booleanisCompact()booleanisCompositeProperty()booleanisOnlyArrayOptions()booleanisQualifier()booleanisSchemaNode()booleanisSimple()booleanisStruct()booleanisURI()voidmergeWith(PropertyOptions options)Merges the set options of a another options object with this.PropertyOptionssetArray(boolean value)PropertyOptionssetArrayAlternate(boolean value)PropertyOptionssetArrayAltText(boolean value)PropertyOptionssetArrayOrdered(boolean value)PropertyOptionssetCompact(boolean value)PropertyOptionssetHasLanguage(boolean value)PropertyOptionssetHasQualifiers(boolean value)PropertyOptionssetHasType(boolean value)PropertyOptionssetQualifier(boolean value)PropertyOptionssetSchemaNode(boolean value)PropertyOptionssetStruct(boolean value)PropertyOptionssetURI(boolean value)-
Methods inherited from class com.adobe.xmp.options.Options
clear, containsAllOptions, containsOneOf, equals, getOptions, getOptionsString, hashCode, isExactly, setOption, setOptions, toString
-
-
-
-
Field Detail
-
NO_OPTIONS
public static final int NO_OPTIONS
- See Also:
- Constant Field Values
-
URI
public static final int URI
- See Also:
- Constant Field Values
-
HAS_QUALIFIERS
public static final int HAS_QUALIFIERS
- See Also:
- Constant Field Values
-
QUALIFIER
public static final int QUALIFIER
- See Also:
- Constant Field Values
-
HAS_LANGUAGE
public static final int HAS_LANGUAGE
- See Also:
- Constant Field Values
-
HAS_TYPE
public static final int HAS_TYPE
- See Also:
- Constant Field Values
-
STRUCT
public static final int STRUCT
- See Also:
- Constant Field Values
-
ARRAY
public static final int ARRAY
- See Also:
- Constant Field Values
-
ARRAY_ORDERED
public static final int ARRAY_ORDERED
- See Also:
- Constant Field Values
-
ARRAY_ALTERNATE
public static final int ARRAY_ALTERNATE
- See Also:
- Constant Field Values
-
ARRAY_ALT_TEXT
public static final int ARRAY_ALT_TEXT
- See Also:
- Constant Field Values
-
COMPACT
public static final int COMPACT
- See Also:
- Constant Field Values
-
SCHEMA_NODE
public static final int SCHEMA_NODE
- See Also:
- Constant Field Values
-
DELETE_EXISTING
public static final int DELETE_EXISTING
may be used in the future- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PropertyOptions
public PropertyOptions()
Default constructor
-
PropertyOptions
public PropertyOptions(int options) throws XMPExceptionIntialization constructor- Parameters:
options- the initialization options- Throws:
XMPException- If the options are not valid
-
-
Method Detail
-
isURI
public boolean isURI()
- Returns:
- Return whether the property value is a URI. It is serialized to RDF using the rdf:resource attribute. Not mandatory for URIs, but considered RDF-savvy.
-
setURI
public PropertyOptions setURI(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
getHasQualifiers
public boolean getHasQualifiers()
- Returns:
- Return whether the property has qualifiers. These could be an xml:lang attribute, an rdf:type property, or a general qualifier. See the introductory discussion of qualified properties for more information.
-
setHasQualifiers
public PropertyOptions setHasQualifiers(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isQualifier
public boolean isQualifier()
- Returns:
- Return whether this property is a qualifier for some other property. Note that if the qualifier itself has a structured value, this flag is only set for the top node of the qualifier's subtree. Qualifiers may have arbitrary structure, and may even have qualifiers.
-
setQualifier
public PropertyOptions setQualifier(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
getHasLanguage
public boolean getHasLanguage()
- Returns:
- Return whether this property has an xml:lang qualifier.
-
setHasLanguage
public PropertyOptions setHasLanguage(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
getHasType
public boolean getHasType()
- Returns:
- Return whether this property has an rdf:type qualifier.
-
setHasType
public PropertyOptions setHasType(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isStruct
public boolean isStruct()
- Returns:
- Return whether this property contains nested fields.
-
setStruct
public PropertyOptions setStruct(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isArray
public boolean isArray()
- Returns:
- Return whether this property is an array. By itself this indicates a general unordered array. It is serialized using an rdf:Bag container.
-
setArray
public PropertyOptions setArray(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isArrayOrdered
public boolean isArrayOrdered()
- Returns:
- Return whether this property is an ordered array. Appears in conjunction with getPropValueIsArray(). It is serialized using an rdf:Seq container.
-
setArrayOrdered
public PropertyOptions setArrayOrdered(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isArrayAlternate
public boolean isArrayAlternate()
- Returns:
- Return whether this property is an alternative array. Appears in conjunction with getPropValueIsArray(). It is serialized using an rdf:Alt container.
-
setArrayAlternate
public PropertyOptions setArrayAlternate(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isArrayAltText
public boolean isArrayAltText()
- Returns:
- Return whether this property is an alt-text array. Appears in conjunction with getPropArrayIsAlternate(). It is serialized using an rdf:Alt container. Each array element is a simple property with an xml:lang attribute.
-
setArrayAltText
public PropertyOptions setArrayAltText(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isCompact
public boolean isCompact()
- Returns:
- Return whether the value is a compact struct or array.
-
setCompact
public PropertyOptions setCompact(boolean value)
- Parameters:
value- the value to set- Returns:
- Returns this to enable cascaded options.
-
isSchemaNode
public boolean isSchemaNode()
- Returns:
- Returns whether the SCHEMA_NODE option is set.
-
setSchemaNode
public PropertyOptions setSchemaNode(boolean value)
- Parameters:
value- the option DELETE_EXISTING to set- Returns:
- Returns this to enable cascaded options.
-
isCompositeProperty
public boolean isCompositeProperty()
- Returns:
- Returns whether the property is of composite type - an array or a struct.
-
isSimple
public boolean isSimple()
- Returns:
- Returns whether the property is of composite type - an array or a struct.
-
equalArrayTypes
public boolean equalArrayTypes(PropertyOptions options)
Compares two options set for array compatibility.- Parameters:
options- other options- Returns:
- Returns true if the array options of the sets are equal.
-
mergeWith
public void mergeWith(PropertyOptions options) throws XMPException
Merges the set options of a another options object with this. If the other options set is null, this objects stays the same.- Parameters:
options- other options- Throws:
XMPException- If illegal options are provided
-
isOnlyArrayOptions
public boolean isOnlyArrayOptions()
- Returns:
- Returns true if only array options are set.
-
assertConsistency
public void assertConsistency(int options) throws XMPExceptionChecks that a node not a struct and array at the same time; and URI cannot be a struct.- Parameters:
options- the bitmask to check.- Throws:
XMPException- Thrown if the options are not consistent.
-
-