Package org.faceless.pdf2
Class XMP.Schema
- java.lang.Object
-
- org.faceless.pdf2.XMP.Schema
-
- Enclosing class:
- XMP
public static class XMP.Schema extends java.lang.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.
-
-
Constructor Summary
Constructors Constructor Description Schema(java.lang.String uri, java.lang.String prefix, java.lang.String description)
Create a new custom Schema.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getDescription()
Return the Description of the Schemajava.lang.String
getPrefix()
Return the preferred prefix of the Schemajava.util.Map<java.lang.String,XMP.Property>
getProperties()
Return a read-only collection of the Properties defined in this Schema.java.util.Map<java.lang.String,XMP.Type>
getTypes()
Return a read-only collection of the Types defined in this Schema.java.lang.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(java.lang.String name, XMP.Type type, java.lang.String description, boolean external)
Create a new property on this Schema.XMP.Property
newQualifierProperty(java.lang.String name, XMP.Type type, java.lang.String description, boolean external)
Create a new qualifier property on this Schema.XMP.Type
newType(java.lang.String name, java.lang.String description)
Create a new Type on this Schema.java.lang.String
toString()
-
-
-
Constructor Detail
-
Schema
public Schema(java.lang.String uri, java.lang.String prefix, java.lang.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 java.lang.String getPrefix()
Return the preferred prefix of the Schema
-
getURI
public java.lang.String getURI()
Return the URI of the Schema
-
getDescription
public java.lang.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 java.util.Map<java.lang.String,XMP.Property> getProperties()
Return a read-only collection of the Properties defined in this Schema. The key isXMP.Property.getName()
-
getTypes
public java.util.Map<java.lang.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(java.lang.String name, XMP.Type type, java.lang.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(java.lang.String name, XMP.Type type, java.lang.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(java.lang.String name, java.lang.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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-