Package com.adobe.xmp.schema.model
Interface PropertyDescription
-
- All Superinterfaces:
java.io.Serializable
public interface PropertyDescription extends java.io.Serializable
Describes an XMP property that can live either in anSchemaDescription
as top-level property or or in anStructType
as a struct field.
When added to a schema description it has to be in the same namespace as the parent schema.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
accept(SchemaVisitor schemaVisitor)
void
addQualifier(PropertyDescription qualifier)
Add a qualifier to the property.java.util.Map<java.lang.String,java.lang.String>
getDecorator(java.lang.String namespaceURI, java.lang.String localName)
Gets a user defined decorator map.java.util.Set<javax.xml.namespace.QName>
getDecoratorSet()
Retrieves a list of all decorators, sorted by QName.java.lang.String
getDescription()
java.lang.String
getLabel()
java.lang.String
getName()
java.lang.String
getNamespaceURI()
The namespace URI of the property.PropertyDescription
getQualifier(java.lang.String namespaceURI, java.lang.String localName)
Gets a qualifier by namespace and local name if existing.java.util.List<PropertyDescription>
getQualifiers()
PropertyType
getType()
boolean
hasDecorator(java.lang.String myNamespace, java.lang.String myDecorator)
Request if a decorator exists AND contains at least one property.boolean
hasDecorators()
boolean
hasQualifiers()
boolean
isDeprecated()
Denotes that this property shall not be used anymore, while it is still accepted.boolean
isMandatory()
The mandatory flag denotes that a property has to be specified in an XMP data object.boolean
isReadOnly()
Read-only is a hint for UI generators and indicate that the property should not be modified by the user, and is rather maintained by the application.void
removeDecoratorNS(java.lang.String namespaceURI)
Removes all decorators from one namespace.void
removeQualifier(java.lang.String namespaceURI, java.lang.String localName)
Removes a qualifier by namespace and local name.void
replaceType(PropertyType finalType)
Replaces an UnspecifiedType with a final PropertyType.void
setDeprecated(boolean deprecated)
void
setDescription(java.lang.String description)
void
setLabel(java.lang.String label)
void
setMandatory(boolean mandatory)
void
setNamespaceURI(java.lang.String namespaceURI)
void
setReadOnly(boolean readOnly)
-
-
-
Method Detail
-
getNamespaceURI
java.lang.String getNamespaceURI()
The namespace URI of the property. While all properties of a schema have to be in the same namespace, a struct can contain properties of different namespaces.- Returns:
- Returns the namespace URI
-
setNamespaceURI
void setNamespaceURI(java.lang.String namespaceURI)
- Parameters:
namespaceURI
- the namespace to set
-
getName
java.lang.String getName()
- Returns:
- Returns the property name. It is a local name in the context of XML namespaces.
-
getType
PropertyType getType()
- Returns:
- Returns the type of the property. Can be simple, array or struct.
-
replaceType
void replaceType(PropertyType finalType)
Replaces an UnspecifiedType with a final PropertyType. This method is only needed by schema parsers.- Parameters:
finalType
- the type that replaces the unspecified type.
-
addQualifier
void addQualifier(PropertyDescription qualifier)
Add a qualifier to the property. A qualifier behaves exactly like a normal XMP property. A property must not have two qualifiers that have the same QName.- Parameters:
qualifier
- the qualifier to add.
-
getQualifier
PropertyDescription getQualifier(java.lang.String namespaceURI, java.lang.String localName)
Gets a qualifier by namespace and local name if existing.- Parameters:
namespaceURI
- the qualifier's namespacelocalName
- the qualifier's local name- Returns:
- Returns the qualifier or
null
if not existing.
-
getQualifiers
java.util.List<PropertyDescription> getQualifiers()
- Returns:
- Returns the collection of all qualifiers
-
removeQualifier
void removeQualifier(java.lang.String namespaceURI, java.lang.String localName)
Removes a qualifier by namespace and local name.- Parameters:
namespaceURI
- the qualifier's namespacelocalName
- the qualifier's local name
-
hasQualifiers
boolean hasQualifiers()
- Returns:
- Returns true if the property has at least on qualifier.
-
isMandatory
boolean isMandatory()
The mandatory flag denotes that a property has to be specified in an XMP data object. This applies only when the schema is specified at all. It does not indicate that this property has to specified in each XMP data set.- Returns:
- Returns true if the property is mandatory.
-
setMandatory
void setMandatory(boolean mandatory)
- Parameters:
mandatory
- the mandatory flag to set
-
isDeprecated
boolean isDeprecated()
Denotes that this property shall not be used anymore, while it is still accepted. A validator could generate a warning when coming across a deprecated property.- Returns:
- Returns the deprecated flag.
-
setDeprecated
void setDeprecated(boolean deprecated)
- Parameters:
deprecated
- the deprecated flag to set
-
getLabel
java.lang.String getLabel()
- Returns:
- Returns the default label for the property.
-
setLabel
void setLabel(java.lang.String label)
- Parameters:
label
- Sets the default label
-
getDescription
java.lang.String getDescription()
- Returns:
- Returns the default description for this property.
-
setDescription
void setDescription(java.lang.String description)
- Parameters:
description
- Sets the default description
-
isReadOnly
boolean isReadOnly()
Read-only is a hint for UI generators and indicate that the property should not be modified by the user, and is rather maintained by the application. This flag is similar to the internal (read-only) / external (read/write) term that we used in our spec. Note: this flag is under discussion.- Returns:
- Returns true if the property is read-only, and false if the property may be edited.
-
setReadOnly
void setReadOnly(boolean readOnly)
- Parameters:
readOnly
- Sets the readonly flag
-
accept
void accept(SchemaVisitor schemaVisitor) throws XMPSchemaException
- Parameters:
schemaVisitor
- a visitor that implements theSchemaVisitor
-interface- Throws:
XMPSchemaException
-
getDecorator
java.util.Map<java.lang.String,java.lang.String> getDecorator(java.lang.String namespaceURI, java.lang.String localName)
Gets a user defined decorator map. To add decorators, get the map and add property-value pairs. It is implicitly created, when empty.- Parameters:
namespaceURI
- namespace for the decorator taglocalName
- name of the decorator tag- Returns:
- Returns a decorator map. It may be empty, but is never
null
.
-
hasDecorator
boolean hasDecorator(java.lang.String myNamespace, java.lang.String myDecorator)
Request if a decorator exists AND contains at least one property. Unlike the get-method, this method does not create an empty decorator when it has not existed before.- Parameters:
namespaceURI
- namespace for the decorator taglocalName
- name of the decorator tag- Returns:
- Returns whether a decorator exists or not.
-
hasDecorators
boolean hasDecorators()
- Returns:
- Returns true when the property contains at least one decorator.
-
getDecoratorSet
java.util.Set<javax.xml.namespace.QName> getDecoratorSet()
Retrieves a list of all decorators, sorted by QName. To get the values the methodgetDecorator(String, String)
.- Returns:
- Returns a list of QNames of all decorators
-
removeDecoratorNS
void removeDecoratorNS(java.lang.String namespaceURI)
Removes all decorators from one namespace.- Parameters:
namespaceURI
- a decorator namespace URI
-
-