|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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
error
public void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
- Displays an error message on the console, or no-op if in quiet mode.
In all cases, it throws a
SAXException
to signify that processing
should stop.
- Specified by:
error
in interface org.xml.sax.ErrorHandler
- Overrides:
error
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Saves the document locator that the parser might provide. If it does so,
we are in business, else, we're toast...
- Specified by:
setDocumentLocator
in interface org.xml.sax.ContentHandler
- Overrides:
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
setVerbose
public void setVerbose(boolean b)
- Description copied from interface:
Builder
- Makes the Builder more verbose than normal.
If the Builder is verbose, it should log all start and end elements
to the logging stream.
This attribute is mutually exclusive with quiet.
- Specified by:
setVerbose
in interface Builder
- Parameters:
b
- true
to make the Builder verbose,
false
otherwise.
addResolver
public void addResolver(org.xml.sax.EntityResolver resolver)
- Description copied from interface:
Builder
- Adds an
EntityResolver
through which this Builder
should try to resolve entities before letting the default handling
do it's job.
- Specified by:
addResolver
in interface Builder
- Parameters:
resolver
- An EntityResolver
that will be
used while building the window.
resolveEntity
public org.xml.sax.InputSource resolveEntity(String publicId,
String systemId)
throws org.xml.sax.SAXException
- Specified by:
resolveEntity
in interface org.xml.sax.EntityResolver
- Overrides:
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright 2002-2003, Fran�ois Beausoleil, All Rights Reserved