Class ModelLoader


  • public final class ModelLoader
    extends Object
    Builds a Model object. This is an utility class that makes it easy to load a grammar object from various sources.
    Author:
    Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
    • Constructor Detail

      • ModelLoader

        public ModelLoader​(Options _opt,
                           com.sun.codemodel.JCodeModel _codeModel,
                           ErrorReceiver er)
    • Method Detail

      • load

        public static Model load​(Options opt,
                                 com.sun.codemodel.JCodeModel codeModel,
                                 ErrorReceiver er)
        A convenience method to load schemas into a Model.
      • loadXMLSchema

        public com.sun.xml.xsom.XSSchemaSet loadXMLSchema()
                                                   throws SAXException
        Parses a set of XML Schema files into an annotated grammar.
        Throws:
        SAXException
      • annotateXMLSchema

        public Model annotateXMLSchema​(com.sun.xml.xsom.XSSchemaSet xs)
        Annotates the obtained schema set.
        Returns:
        null if an error happens. In that case, the error messages will be properly reported to the controller by this method.
      • createXSOMParser

        public com.sun.xml.xsom.parser.XSOMParser createXSOMParser​(com.sun.xml.xsom.parser.XMLParser parser)
        Potentially problematic - make sure the parser instance passed is initialized with proper security feature.
        Parameters:
        parser -
        Returns:
      • createXSOMParser

        public com.sun.xml.xsom.parser.XSOMParser createXSOMParser​(DOMForest forest)