Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.ant.internal.ui.dtd
Class Parser  view Parser download Parser.java

java.lang.Object
  extended byorg.eclipse.ant.internal.ui.dtd.Parser

public class Parser
extends java.lang.Object

Simple parser for DTDs. Returns ISchema representing the DTD. To parse a DTD, you must parse an XML document. The parseDTD() method builds a temporary XML document in memory that refers to or includes the DTD. There is no dependency in this package on any code outside the package except XMLReader. To hide the underlying parser, XML parser exceptions are wrapped by a ParseError. Unless debugging, the two string constants are sufficient to determine the cause of the error.


Nested Class Summary
private static class Parser.DTDEntityResolver
           
private static class Parser.DTDReader
           
 
Field Summary
private static java.lang.String INTERNAL
           
static java.lang.String NOT_SUPPORTED
          ParseError message when system parser doesn't do the job
static java.lang.String PARSE_ERROR
          ParseError message for a well-formed or validation error in XML or DTD.
 
Constructor Summary
Parser()
           
 
Method Summary
private  org.xml.sax.XMLReader getXMLReader()
           
 ISchema parse(org.xml.sax.InputSource inputSource, org.xml.sax.EntityResolver entityResolver)
          Parse the XML document at the input source and return a document walker that can be used to validate any document with the same DTD (internal and external) or provide user assistance for this document.
 ISchema parse(java.io.Reader reader)
          Parse the XML document using the argument reader and return a document walker that can be used to validate any document with the same DTD (internal and external) or provide user assistance for this document.
 ISchema parse(java.lang.String url)
          Parse the XML document at the argument URL and return a document walker that can be used to validate any document with the same DTD (internal and external) or provide user assistance for this document.
 ISchema parseDTD(java.io.Reader reader, java.lang.String root)
          Parse the DTD from the reader and return a document walker that can be used to validate or provide user assistance for any document with the same external DTD and no internal subset.
 ISchema parseDTD(java.lang.String pub, java.lang.String sys, java.lang.String root)
          Parse the DTD with the given public and system ids and return a document walker that can be used to validate or provide user assistance for any document with the same external DTD and no internal subset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_SUPPORTED

public static final java.lang.String NOT_SUPPORTED
ParseError message when system parser doesn't do the job


PARSE_ERROR

public static final java.lang.String PARSE_ERROR
ParseError message for a well-formed or validation error in XML or DTD. Currently not returned.


INTERNAL

private static final java.lang.String INTERNAL
See Also:
Constant Field Values
Constructor Detail

Parser

public Parser()
Method Detail

parse

public ISchema parse(org.xml.sax.InputSource inputSource,
                     org.xml.sax.EntityResolver entityResolver)
              throws ParseError,
                     java.io.IOException
Parse the XML document at the input source and return a document walker that can be used to validate any document with the same DTD (internal and external) or provide user assistance for this document.


getXMLReader

private org.xml.sax.XMLReader getXMLReader()
                                    throws ParseError

parse

public ISchema parse(java.lang.String url)
              throws ParseError,
                     java.io.IOException
Parse the XML document at the argument URL and return a document walker that can be used to validate any document with the same DTD (internal and external) or provide user assistance for this document.


parse

public ISchema parse(java.io.Reader reader)
              throws ParseError,
                     java.io.IOException
Parse the XML document using the argument reader and return a document walker that can be used to validate any document with the same DTD (internal and external) or provide user assistance for this document.


parseDTD

public ISchema parseDTD(java.lang.String pub,
                        java.lang.String sys,
                        java.lang.String root)
                 throws ParseError,
                        java.io.IOException
Parse the DTD with the given public and system ids and return a document walker that can be used to validate or provide user assistance for any document with the same external DTD and no internal subset.


parseDTD

public ISchema parseDTD(java.io.Reader reader,
                        java.lang.String root)
                 throws ParseError,
                        java.io.IOException
Parse the DTD from the reader and return a document walker that can be used to validate or provide user assistance for any document with the same external DTD and no internal subset.