Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

oracle.adf.model.adapter.dataformat.xml
Class SchemaParser

java.lang.Object
  extended by oracle.adf.model.adapter.dataformat.xml.SchemaParser

public class SchemaParser
extends java.lang.Object

Attempts to parses the given XSD document even in cases where the <import> elements do not specify schemaLocation attribute.

The parser works in a recursive fashion and parses the imported schemas and namespaces in all the referred schemas. It builds a list of all the schemas referred directly or indirectly and calls XSDBuilder.build(XMLDocument[], URL) to build the schema.

Input for parsing can be set using any of the addSchema methods. Alternatively, if only one schema document is to be parser, one of the parse methods may be used. The parse methods return XMLSchema object representing the parsed schema document.


Constructor Summary
SchemaParser()
          Creates a blank parser.
 
Method Summary
 void addSchema(java.io.InputStream xsdStream)
          Add a schema definition specified by its InputStream to the pipeline.
 void addSchema(Node node)
          Add a schema defintion specified by the Node.
 void addSchema(java.io.Reader xsdReader)
          Add a schema defintion specified by its Reader to the pipeline.
 void addSchema(java.lang.String xsdLocation)
          Add a schema defintion specified by its URL location to the pipeline.
 void addSchema(java.net.URL xsdURL)
          Add a schema defintion specified by its URL to the pipeline.
 SchemaMetadata getSchemaMetadata(java.lang.String targetNamespace)
          Returns meta data of the schema given its target namespace.
static void main(java.lang.String[] args)
           
 XMLSchema parse()
          Iterates the schema list, scans and parses the schema definitions specified therein.
 XMLSchema parse(java.io.InputStream xsdStream)
          Parses the schema definition specified by its InputStream.
 XMLSchema parse(java.io.Reader xsdReader)
          Parses the schema definition specified by its Reader.
 XMLSchema parse(java.lang.String xsdLocation)
          Parses the schema definition specified by its URL location.
 XMLSchema parse(java.net.URL xsdURL)
          Parses the schema definition specified by its URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaParser

public SchemaParser()
Creates a blank parser.

Method Detail

parse

public XMLSchema parse(java.lang.String xsdLocation)
                throws java.lang.Exception
Parses the schema definition specified by its URL location.

Parameters:
xsdLocation - Location of the XSD document that is to be parsed.
Returns:
Returns the parsed schema as an XMLSchema object.
Throws:
java.lang.Exception - If error occurs while parsing the schema/s.

parse

public XMLSchema parse(java.net.URL xsdURL)
                throws java.lang.Exception
Parses the schema definition specified by its URL.

Parameters:
xsdURL - URL of the XSD document that is to be parsed.
Returns:
Returns the parsed schema as an XMLSchema object.
Throws:
java.lang.Exception - If error occurs while parsing the schema/s.

parse

public XMLSchema parse(java.io.Reader xsdReader)
                throws java.lang.Exception
Parses the schema definition specified by its Reader.

Parameters:
xsdReader - Reader object containing the schema defintion.
Returns:
Returns the parsed schema as an XMLSchema object.
Throws:
java.lang.Exception - If error occurs while parsing the schema/s.

parse

public XMLSchema parse(java.io.InputStream xsdStream)
                throws java.lang.Exception
Parses the schema definition specified by its InputStream.

Parameters:
xsdStream - InputStream containing the schema definition.
Returns:
Returns the parsed schema as an XMLSchema object.
Throws:
java.lang.Exception - If error occurs while parsing the schema/s.

addSchema

public void addSchema(java.lang.String xsdLocation)
               throws java.lang.Exception
Add a schema defintion specified by its URL location to the pipeline.

Parameters:
xsdLocation - URL location of the schema defintion.
Throws:
java.lang.Exception - If error occurs while adding this defintion to the list. The URL location might be invalid or inaccessible.

addSchema

public void addSchema(java.net.URL xsdURL)
               throws java.lang.Exception
Add a schema defintion specified by its URL to the pipeline.

Parameters:
xsdURL - URL of the schema definition.
Throws:
java.lang.Exception - If error occus while adding this definition to the list. The URL might be invalid or inaccessible.

addSchema

public void addSchema(java.io.Reader xsdReader)
Add a schema defintion specified by its Reader to the pipeline.

Parameters:
xsdReader - Reader object containing the schema definition.

addSchema

public void addSchema(java.io.InputStream xsdStream)
Add a schema definition specified by its InputStream to the pipeline.

Parameters:
xsdStream - InputStream object containing the schema definition.

addSchema

public void addSchema(Node node)
Add a schema defintion specified by the Node.

Parameters:
node - Root node of the schema defintion.

getSchemaMetadata

public SchemaMetadata getSchemaMetadata(java.lang.String targetNamespace)
Returns meta data of the schema given its target namespace.

Parameters:
targetNamespace - Target namespace of the schema document whose meta data is required
Returns:
Returns a SchemaMetadata object enclosing the schema's meta data. If the target namespace does not exist, null is returned.

parse

public XMLSchema parse()
                throws java.lang.Exception
Iterates the schema list, scans and parses the schema definitions specified therein.

Returns:
Parsed XML Schema document
Throws:
java.lang.Exception - If error occurs while parsing the schema definitions.

main

public static void main(java.lang.String[] args)

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1)

E10653-04

Copyright © 1997, 2010, Oracle. All rights reserved.