Package org.faceless.pdf2
Class XMP.Schema
- java.lang.Object
-
- org.faceless.pdf2.XMP.Schema
-
- Enclosing class:
- XMP
public static class XMP.Schema extends Object
A Schema is a collection of properties and types, grouped together under a single XML namespace. A large number of predefined Schema are shipped with this class, and it's possible to create new Schema as well to defined custom properties or types.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getDescription()
Return the Description of the SchemaString
getPrefix()
Return the preferred prefix of the SchemaMap<String,XMP.Property>
getProperties()
Return a read-only collection of the Properties defined in this Schema.Map<String,XMP.Type>
getTypes()
Return a read-only collection of the Types defined in this Schema.String
getURI()
Return the URI of the Schemaint
hashCode()
boolean
isValid()
Return true if the URI ends with a '/' or '#', which is recommended for XMP and a requirement for PDF/AXMP.Property
newProperty(String name, XMP.Type type, String description, boolean external)
Create a new property on this Schema.XMP.Property
newQualifierProperty(String name, XMP.Type type, String description, boolean external)
Create a new qualifier property on this Schema.XMP.Type
newType(String name, String description)
Create a new Type on this Schema.String
toString()
-
-
-
Constructor Detail
-
Schema
public Schema(String uri, String prefix, String description)
Create a new custom Schema.- Parameters:
uri
- the namespace URI. It is required (in XMP until 2008) and recommended (in modern XMP) that the namespace ends with a "#" or "/" characterprefix
- the preferred prefix to use when serializing properties in this namespacedescription
- a description of this Schema, which will be used when creating a PDF/A extension schema.
-
-
Method Detail
-
getPrefix
public String getPrefix()
Return the preferred prefix of the Schema
-
getURI
public String getURI()
Return the URI of the Schema
-
getDescription
public String getDescription()
Return the Description of the Schema
-
isValid
public boolean isValid()
Return true if the URI ends with a '/' or '#', which is recommended for XMP and a requirement for PDF/A- Since:
- 2.25
-
getProperties
public Map<String,XMP.Property> getProperties()
Return a read-only collection of the Properties defined in this Schema. The key isXMP.Property.getName()
-
getTypes
public Map<String,XMP.Type> getTypes()
Return a read-only collection of the Types defined in this Schema. The key isXMP.Type.getName()
-
newProperty
public XMP.Property newProperty(String name, XMP.Type type, String description, boolean external)
Create a new property on this Schema. If an Property exists with this name, it will be replaced- Parameters:
name
- the name of the Property, which must not be nulltype
- the type of the Proeprty, which must not be nulldescription
- the description of the Property, which must not be null and will be used when creating a PDF/A extension schemaexternal
- whether the Property is internal or external. Required, but purpose unknown and it doesn't seem to make any difference.- Returns:
- the Property
-
newQualifierProperty
public XMP.Property newQualifierProperty(String name, XMP.Type type, String description, boolean external)
Create a new qualifier property on this Schema. If an Property exists with this name, it will be replaced The returned property can only be used to qualify other properties- Parameters:
name
- the name of the Property, which must not be nulltype
- the type of the Proeprty, which must not be nulldescription
- the description of the Property, which must not be null and will be used when creating a PDF/A extension schemaexternal
- whether the Property is internal or external. Required, but purpose unknown and it doesn't seem to make any difference.- Returns:
- the Property
- See Also:
XMP.Value.putQualifier(org.faceless.pdf2.XMP.Property, org.faceless.pdf2.XMP.Value)
-
newType
public XMP.Type newType(String name, String description)
Create a new Type on this Schema. If a Type exists with this name, it will be replaced.- Parameters:
name
- the name of the Type, which must not be nulldescription
- the decription of the Type, which must not be null- Returns:
- the Type
-
-