|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.helpers.DefaultHandler | +--jgb.builder.DefaultBuilder
The class that builds the windows and controls on behalf of the application. This class instantiates the necessary objects while reading the XML source file.
Constructor Summary | |
DefaultBuilder()
Instantiate a Builder and use the default
TagHandlerFactory .
|
|
DefaultBuilder(jgb.builder.TagHandlerFactory tagsFactory)
Instantiate a Builder with the specified
TagHandlerFactory .
|
Method Summary | |
void |
addResolver(org.xml.sax.EntityResolver resolver)
Adds an EntityResolver through which this Builder
should try to resolve entities before letting the default handling
do it's job. |
Component |
build(org.xml.sax.InputSource in)
Initiates building of the objects by reading the specified InputSource .
|
Component |
build(InputStream in)
Initiates building of the objects by reading the specified InputStream .
|
void |
endElement(String namespaceURI,
String localName,
String qName)
Terminates processing of the given element. |
void |
error(org.xml.sax.SAXParseException e)
Displays an error message on the console, or no-op if in quiet mode. |
void |
fatalError(org.xml.sax.SAXParseException e)
Displays a fatal error message on the console, or no-op if in quiet mode. |
Object |
getObject(String name)
|
org.xml.sax.InputSource |
resolveEntity(String publicId,
String systemId)
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
Saves the document locator that the parser might provide. |
void |
setLoggingStream(PrintWriter logStream)
Specifies the stream to which warnings, errors, fatal errors and elements should be reported. |
void |
setQuiet(boolean quiet)
Initiates or terminates quiet mode. |
void |
setVerbose(boolean b)
Makes the Builder more verbose than normal. |
void |
startElement(String namespaceURI,
String localName,
String qName,
org.xml.sax.Attributes atts)
Initiates processing of the given element. |
void |
warning(org.xml.sax.SAXParseException e)
Displays a warning message on the console, or no-op if in quiet mode. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping |
Constructor Detail |
public DefaultBuilder()
Builder
and use the default
TagHandlerFactory
.
The default factory is PackageTagHandlerFactory
.
public DefaultBuilder(jgb.builder.TagHandlerFactory tagsFactory)
Builder
with the specified
TagHandlerFactory
.
The Builder
uses this factory to get all of it's tag handlers.
All tags must implement TagHandler
.
Method Detail |
public void setQuiet(boolean quiet)
Builder
When in quiet mode, the Builder will not report any messages to the logging stream. By default, the Builder is NOT quiet.
This attribute is mutually exclusive with verbose.
setQuiet
in interface Builder
quiet
- true
to make the Builder quiet,
false
otherwise.public Component build(InputStream in) throws IOException, org.xml.sax.SAXException
Builder
InputStream
.
This stream will be parsed as an XML file. The parser used to parse
the file will be validating.
build
in interface Builder
org.xml.sax.SAXException
- If a parser could not be instantiated, or a build
error occurs.
IOException
- If an I/O error occurs while reading the stream.public Component build(org.xml.sax.InputSource in) throws IOException, org.xml.sax.SAXException
Builder
InputSource
.
The parser used to parse the source will be validating.
build
in interface Builder
IOException
- If an I/O error occurs while reading the stream.
org.xml.sax.SAXException
- If a parser could not be instantiated, or a build
error occurs.public void setLoggingStream(PrintWriter logStream)
Builder
setLoggingStream
in interface Builder
logStream
- The stream to which information will be sent.public Object getObject(String name)
getObject
in interface WindowContext
public void startElement(String namespaceURI, String localName, String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
TagHandler
to process this tag.
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void endElement(String namespaceURI, String localName, String qName) throws org.xml.sax.SAXException
TagHandler
to process this tag.
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void warning(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
warning
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
SAXException to signify that processing
should stop.
- Specified by:
fatalError
in interface org.xml.sax.ErrorHandler
- Overrides:
fatalError
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
SAXException
to signify that processing
should stop.
error
in interface org.xml.sax.ErrorHandler
error
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
public void setVerbose(boolean b)
Builder
If the Builder is verbose, it should log all start and end elements to the logging stream.
This attribute is mutually exclusive with quiet.
setVerbose
in interface Builder
b
- true
to make the Builder verbose,
false
otherwise.public void addResolver(org.xml.sax.EntityResolver resolver)
Builder
EntityResolver
through which this Builder
should try to resolve entities before letting the default handling
do it's job.
addResolver
in interface Builder
resolver
- An EntityResolver
that will be
used while building the window.public org.xml.sax.InputSource resolveEntity(String publicId, String systemId) throws org.xml.sax.SAXException
resolveEntity
in interface org.xml.sax.EntityResolver
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |