|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--XmlApp
Base class for Ælfred demonstration applications.
This class fills in the basic interface, and provides an I/O infrastructure for simple applications and applets.
XmlParser
,
XmlHandler
,
EventDemo
,
TimerDemo
,
DtdDemo
,
StreamDemo
Field Summary | |
boolean |
isApplet
Flag to show whether we're running as an applet or application. |
com.microstar.xml.XmlParser |
parser
|
Constructor Summary | |
XmlApp()
|
Method Summary | |
void |
attribute(java.lang.String name,
java.lang.String value,
boolean isSpecified)
Handle an attribute value specification. |
void |
charData(char[] ch,
int start,
int length)
Handle character data. |
void |
doctypeDecl(java.lang.String name,
java.lang.String pubid,
java.lang.String sysid)
Handle a DOCTYPE declaration. |
void |
endDocument()
Handle the end the document. |
void |
endElement(java.lang.String name)
Handle the end of an element. |
void |
endExternalEntity(java.lang.String systemId)
End an external entity. |
void |
error(java.lang.String message,
java.lang.String url,
int line,
int column)
Handle a parsing error. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Handle ignorable whitespace. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Handle a processing instruction. |
java.lang.Object |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
Resolve an external entity. |
void |
startDocument()
Handle the start of the document. |
void |
startElement(java.lang.String name)
Handle the start of an element. |
void |
startExternalEntity(java.lang.String systemId)
Begin an external entity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public boolean isApplet
public com.microstar.xml.XmlParser parser
Constructor Detail |
public XmlApp()
Method Detail |
public java.lang.Object resolveEntity(java.lang.String publicId, java.lang.String systemId)
This method could generate a new URL by looking up the public identifier in a hash table, or it could replace the URL supplied with a different, local one; for now, however, just return the URL supplied.
resolveEntity
in interface XmlHandler
publicId
- The public identifier, or null if none was supplied.systemId
- The system identifier.
com.Microstar.xml.XmlHandler#resolveEntity
public void startExternalEntity(java.lang.String systemId)
XmlHandler
Ælfred will call this method at the beginning of each external entity, including the top-level document entity and the external DTD subset (if any).
If necessary, you can use this method to track the location of the current entity so that you can resolve relative URIs correctly.
startExternalEntity
in interface XmlHandler
systemId
- The URI of the external entity that is starting.XmlHandler.endExternalEntity(java.lang.String)
,
XmlHandler.resolveEntity(java.lang.String, java.lang.String)
public void endExternalEntity(java.lang.String systemId)
XmlHandler
Ælfred will call this method at the end of each external entity, including the top-level document entity and the external DTD subset.
If necessary, you can use this method to track the location of the current entity so that you can resolve relative URIs correctly.
endExternalEntity
in interface XmlHandler
systemId
- The URI of the external entity that is ending.XmlHandler.startExternalEntity(java.lang.String)
,
XmlHandler.resolveEntity(java.lang.String, java.lang.String)
public void startDocument()
Do nothing for now. Subclasses can override this method if they want to take a specific action.
This method will always be called first.
startDocument
in interface XmlHandler
com.Microstar.xml.XmlHandler#startDocument
public void endDocument()
Do nothing for now. Subclasses can override this method if they want to take a specific action.
This method will always be called last.
endDocument
in interface XmlHandler
com.Microstar.xml.XmlHandler#endDocument
public void doctypeDecl(java.lang.String name, java.lang.String pubid, java.lang.String sysid)
Do nothing for now. Subclasses can override this method if they want to take a specific action.
Well-formed XML documents might not have one of these.
The query methods in XmlParser will return useful values only after this callback.
doctypeDecl
in interface XmlHandler
name
- The document type name.pubid
- The public identifier, or null if unspecified.sysid
- The system identifier, or null if unspecified.com.Microstar.xml.XmlHandler#doctypeDecl
public void attribute(java.lang.String name, java.lang.String value, boolean isSpecified)
Do nothing for now. Subclasses can override this method if they want to take a specific action.
attribute
in interface XmlHandler
value
- The value of the attribute, or null if the attribute
is #IMPLIED
.isSpecified
- True if the value was specified, false if it
was defaulted from the DTD.com.Microstar.xml.XmlHandler#attribute
public void startElement(java.lang.String name)
Do nothing for now. Subclasses can override this method if they want to take a specific action.
startElement
in interface XmlHandler
name
- The element type name.com.Microstar.xml.XmlHandler#startElement
public void endElement(java.lang.String name)
Do nothing for now. Subclasses can override this method if they want to take a specific action.
endElement
in interface XmlHandler
name
- The element type name.com.Microstar.xml.XmlHandler#endElement
public void charData(char[] ch, int start, int length)
Do nothing for now. Subclasses can override this method if they want to take a specific action.
charData
in interface XmlHandler
ch
- The character data.start
- The starting position in the array.length
- The number of characters available.com.Microstar.xml.XmlHandler#charData
public void ignorableWhitespace(char[] ch, int start, int length)
Do nothing for now. Subclasses can override this method if they want to take a specific action.
ignorableWhitespace
in interface XmlHandler
ch
- The literal whitespace characters.start
- The starting position in the array.length
- The number of whitespace characters available.com.Microstar.xml.XmlHandler#ignorableWhitespace
public void processingInstruction(java.lang.String target, java.lang.String data)
Do nothing for now. Subclasses can override this method if they want to take a specific action.
processingInstruction
in interface XmlHandler
target
- The target (the name at the start of the PI).data
- The data, if any (the rest of the PI).com.Microstar.xml.XmlHandler#processingInstruction
public void error(java.lang.String message, java.lang.String url, int line, int column)
By default, print a message and throw an Error.
Subclasses can override this method if they want to do something different.
error
in interface XmlHandler
message
- The error message.url
- The system identifier of the entity that
contains the error.line
- The approximate line number of the error.column
- The approximate column number of the error.com.Microstar.xml.XmlHandler#error
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |