Package org.apache.xmpbox.schema
Class XMPSchemaFactory
- java.lang.Object
-
- org.apache.xmpbox.schema.XMPSchemaFactory
-
public class XMPSchemaFactory extends java.lang.Object
A factory for each kind of schemas
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
namespace
private java.lang.String
nsName
private PropertiesDescription
propDef
private java.lang.Class<? extends XMPSchema>
schemaClass
-
Constructor Summary
Constructors Constructor Description XMPSchemaFactory(java.lang.String namespace, java.lang.Class<? extends XMPSchema> schemaClass, PropertiesDescription propDef)
Factory Constructor for basic known schemas
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XMPSchema
createXMPSchema(XMPMetadata metadata, java.lang.String prefix)
Create a schema that corresponding to this factory and add it to metadatajava.lang.String
getNamespace()
Get namespace URI treated by this factoryPropertiesDescription
getPropertyDefinition()
PropertyType
getPropertyType(java.lang.String name)
Get type declared for the name property given
-
-
-
Field Detail
-
namespace
private final java.lang.String namespace
-
schemaClass
private final java.lang.Class<? extends XMPSchema> schemaClass
-
propDef
private final PropertiesDescription propDef
-
nsName
private java.lang.String nsName
-
-
Constructor Detail
-
XMPSchemaFactory
public XMPSchemaFactory(java.lang.String namespace, java.lang.Class<? extends XMPSchema> schemaClass, PropertiesDescription propDef)
Factory Constructor for basic known schemas- Parameters:
namespace
- namespace URI to treatschemaClass
- Class representation associated to this URIpropDef
- Properties Types list associated
-
-
Method Detail
-
getNamespace
public java.lang.String getNamespace()
Get namespace URI treated by this factory- Returns:
- The namespace URI
-
getPropertyType
public PropertyType getPropertyType(java.lang.String name)
Get type declared for the name property given- Parameters:
name
- The property name- Returns:
- null if property name is unknown
-
createXMPSchema
public XMPSchema createXMPSchema(XMPMetadata metadata, java.lang.String prefix) throws XmpSchemaException
Create a schema that corresponding to this factory and add it to metadata- Parameters:
metadata
- Metadata to attach the Schema createdprefix
- The namespace prefix (optional)- Returns:
- the schema created and added to metadata
- Throws:
XmpSchemaException
- When Instancing specified Object Schema failed
-
getPropertyDefinition
public PropertiesDescription getPropertyDefinition()
-
-