Package com.adobe.xmp.schema.rng.parser
Class RelaxNGDataModel
- java.lang.Object
-
- com.adobe.xmp.schema.rng.parser.RelaxNGDataModel
-
public class RelaxNGDataModel extends java.lang.Object
This class models a RelaxNG schema's data model as described by RelaxNG spec. This model can describe either a XMP packet composed of multiple XMP schemas or a single XMP schema. This class provides functionality to traverse the RelaxNG data model to construct the XMP schemas represeted by the model.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaDescription
constructXMPSchema(SchemaGenerationHandler handler)
Gets the schema which is represented by this RelaxNGDataModelstatic RelaxNGDataModel
newInstance(java.net.URI rngFile, org.xml.sax.EntityResolver er)
Construct a RelaxNGDataModel which models the input RelaxNG schema.static RelaxNGDataModel
newInstance(java.net.URI rngFile, org.xml.sax.EntityResolver er, org.xml.sax.ErrorHandler eh)
Construct a RelaxNGDataModel which models the input RelaxNG schema.static RelaxNGDataModel
newInstance(org.xml.sax.InputSource is, org.xml.sax.EntityResolver er)
Construct a RelaxNGDataModel which models the input RelaxNG schema.static RelaxNGDataModel
newInstance(org.xml.sax.InputSource is, org.xml.sax.EntityResolver er, org.xml.sax.ErrorHandler eh)
Construct a RelaxNGDataModel which models the input RelaxNG schema.
-
-
-
Method Detail
-
newInstance
public static RelaxNGDataModel newInstance(java.net.URI rngFile, org.xml.sax.EntityResolver er) throws RNGParseException, RNGInvalidSchemaException, java.net.MalformedURLException, java.io.IOException
Construct a RelaxNGDataModel which models the input RelaxNG schema.- Parameters:
rngFile
- File representing the RelaxNG schemaer
- A RelaxNG schema references and includes multiple other files. This enity resolver should define how these dependecies should be located by RelaxNG schema parser.- Returns:
- RelaxNGDataModel
- Throws:
RNGParseException
- If a exception occured whileRNGInvalidSchemaException
- If the input RelaxNg schema voilates RNG specjava.io.IOException
- if rngFile cannot be resolved or loadedjava.net.MalformedURLException
- If URI is malformed
-
newInstance
public static RelaxNGDataModel newInstance(java.net.URI rngFile, org.xml.sax.EntityResolver er, org.xml.sax.ErrorHandler eh) throws RNGInvalidSchemaException, java.net.MalformedURLException, java.io.IOException
Construct a RelaxNGDataModel which models the input RelaxNG schema.- Parameters:
rngFile
- File representing the RelaxNG schemaer
- A RelaxNG schema references and includes multiple other files. This entity resolver should define how these dependencies should be located by RelaxNG schema parser.eh
- ErrorHandler to handle error call backs generated by RelaxNG schema parser- Returns:
- RelaxNGDataModel
- Throws:
RNGInvalidSchemaException
- If the input RelaxNg schema violates RNG specjava.net.MalformedURLException
- If URI is malformedjava.io.IOException
- if rngFile cannot be resolved or loaded
-
newInstance
public static RelaxNGDataModel newInstance(org.xml.sax.InputSource is, org.xml.sax.EntityResolver er) throws RNGInvalidSchemaException
Construct a RelaxNGDataModel which models the input RelaxNG schema.- Parameters:
is
- InputSource representing the RelaxNG schemaer
- A RelaxNG schema references and includes multiple other files. This entity resolver should define how these dependencies should be located by RelaxNG schema parser.- Returns:
- RelaxNGDataModel
- Throws:
RNGInvalidSchemaException
- If the input RelaxNg schema violates RNG spec
-
newInstance
public static RelaxNGDataModel newInstance(org.xml.sax.InputSource is, org.xml.sax.EntityResolver er, org.xml.sax.ErrorHandler eh) throws RNGInvalidSchemaException
Construct a RelaxNGDataModel which models the input RelaxNG schema.- Parameters:
is
- InputSource representing the RelaxNG schemaer
- A RelaxNG schema references and includes multiple other files. This enity resolver should define how these dependecies should be located by RelaxNG schema parser.eh
- ErrorHandler to handle error call backs generated by RelaxNG schema parser- Returns:
- RelaxNGDataModel
- Throws:
RNGInvalidSchemaException
- If the input RelaxNg schema voilates RNG spec
-
constructXMPSchema
public SchemaDescription constructXMPSchema(SchemaGenerationHandler handler) throws RNGParseException, XMPSchemaException
Gets the schema which is represented by this RelaxNGDataModel- Parameters:
handler
- This handler provides notifications for various events such as start, end of parsing a ref, start of property parsing, errors recieved while parsing property. This should not be null.- Returns:
- First XMP schema from the list of XMP schemas represented by this RelaxNG schema
- Throws:
RNGParseException
- If a problem occured while traversingRelaxNGDataModel
to form aSchemaDescription
object. This can happen if the input Relax NG schema does not correctly model a XMP schema.XMPSchemaException
- Exception thrown forSchemaDescription
is propogated
-
-