com.itextpdf.xmp.options
Class PropertyOptions

java.lang.Object
  extended by com.itextpdf.xmp.options.Options
      extended by com.itextpdf.xmp.options.PropertyOptions

public final class PropertyOptions
extends Options

The property flags are used when properties are fetched from the XMPMeta-object and provide more detailed information about the property.

Since:
03.07.2006

Field Summary
static int ARRAY
           
static int ARRAY_ALT_TEXT
           
static int ARRAY_ALTERNATE
           
static int ARRAY_ORDERED
           
static int DELETE_EXISTING
          may be used in the future
static int HAS_LANGUAGE
           
static int HAS_QUALIFIERS
           
static int HAS_TYPE
           
static int NO_OPTIONS
           
static int QUALIFIER
           
static int SCHEMA_NODE
           
static int STRUCT
           
static int URI
           
 
Constructor Summary
PropertyOptions()
          Default constructor
PropertyOptions(int options)
          Intialization constructor
 
Method Summary
 void assertConsistency(int options)
          Checks that a node not a struct and array at the same time; and URI cannot be a struct.
protected  String defineOptionName(int option)
          To be implemeted by inheritants.
 boolean equalArrayTypes(PropertyOptions options)
          Compares two options set for array compatibility.
 boolean getHasLanguage()
           
 boolean getHasQualifiers()
           
 boolean getHasType()
           
protected  int getValidOptions()
          To be implemeted by inheritants.
 boolean isArray()
           
 boolean isArrayAlternate()
           
 boolean isArrayAltText()
           
 boolean isArrayOrdered()
           
 boolean isCompositeProperty()
           
 boolean isOnlyArrayOptions()
           
 boolean isQualifier()
           
 boolean isSchemaNode()
           
 boolean isSimple()
           
 boolean isStruct()
           
 boolean isURI()
           
 void mergeWith(PropertyOptions options)
          Merges the set options of a another options object with this.
 PropertyOptions setArray(boolean value)
           
 PropertyOptions setArrayAlternate(boolean value)
           
 PropertyOptions setArrayAltText(boolean value)
           
 PropertyOptions setArrayOrdered(boolean value)
           
 PropertyOptions setHasLanguage(boolean value)
           
 PropertyOptions setHasQualifiers(boolean value)
           
 PropertyOptions setHasType(boolean value)
           
 PropertyOptions setQualifier(boolean value)
           
 PropertyOptions setSchemaNode(boolean value)
           
 PropertyOptions setStruct(boolean value)
           
 PropertyOptions setURI(boolean value)
           
 
Methods inherited from class com.itextpdf.xmp.options.Options
clear, containsAllOptions, containsOneOf, equals, getOption, getOptions, getOptionsString, hashCode, isExactly, setOption, setOptions, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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

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 XMPException
Intialization 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.

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.

getValidOptions

protected int getValidOptions()
Description copied from class: Options
To be implemeted by inheritants.

Specified by:
getValidOptions in class Options
Returns:
Returns a bit mask where all valid option bits are set.
See Also:
Options.getValidOptions()

defineOptionName

protected String defineOptionName(int option)
Description copied from class: Options
To be implemeted by inheritants.

Specified by:
defineOptionName in class Options
Parameters:
option - a single, valid option bit.
Returns:
Returns a human readable name for an option bit.
See Also:
Options.defineOptionName(int)

assertConsistency

public void assertConsistency(int options)
                       throws XMPException
Checks that a node not a struct and array at the same time; and URI cannot be a struct.

Overrides:
assertConsistency in class Options
Parameters:
options - the bitmask to check.
Throws:
XMPException - Thrown if the options are not consistent.


Copyright © 2013. All Rights Reserved.