Class 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.
    See Also:
    XMP.addSchema(org.faceless.pdf2.XMP.Schema)
    • 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 "/" character
        prefix - the preferred prefix to use when serializing properties in this namespace
        description - 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
      • 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 null
        type - the type of the Proeprty, which must not be null
        description - the description of the Property, which must not be null and will be used when creating a PDF/A extension schema
        external - 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 null
        type - the type of the Proeprty, which must not be null
        description - the description of the Property, which must not be null and will be used when creating a PDF/A extension schema
        external - 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 null
        description - the decription of the Type, which must not be null
        Returns:
        the Type
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object