Package com.adobe.xmp.schema.rng.parser
Class RelaxNGDataModel
java.lang.Object
com.adobe.xmp.schema.rng.parser.RelaxNGDataModel
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
Modifier and TypeMethodDescriptionGets the schema which is represented by this RelaxNGDataModelstatic RelaxNGDataModelnewInstance(URI rngFile, EntityResolver er) Construct a RelaxNGDataModel which models the input RelaxNG schema.static RelaxNGDataModelnewInstance(URI rngFile, EntityResolver er, ErrorHandler eh) Construct a RelaxNGDataModel which models the input RelaxNG schema.static RelaxNGDataModelnewInstance(InputSource is, EntityResolver er) Construct a RelaxNGDataModel which models the input RelaxNG schema.static RelaxNGDataModelnewInstance(InputSource is, EntityResolver er, ErrorHandler eh) Construct a RelaxNGDataModel which models the input RelaxNG schema.
-
Method Details
-
newInstance
public static RelaxNGDataModel newInstance(URI rngFile, EntityResolver er) throws RNGParseException, RNGInvalidSchemaException, MalformedURLException, 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 specIOException- if rngFile cannot be resolved or loadedMalformedURLException- If URI is malformed
-
newInstance
public static RelaxNGDataModel newInstance(URI rngFile, EntityResolver er, ErrorHandler eh) throws RNGInvalidSchemaException, MalformedURLException, 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 specMalformedURLException- If URI is malformedIOException- if rngFile cannot be resolved or loaded
-
newInstance
public static RelaxNGDataModel newInstance(InputSource is, 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(InputSource is, EntityResolver er, 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 traversingRelaxNGDataModelto form aSchemaDescriptionobject. This can happen if the input Relax NG schema does not correctly model a XMP schema.XMPSchemaException- Exception thrown forSchemaDescriptionis propogated
-