|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.simonstl.gorille.Context
Created by IntelliJ IDEA. User: simon Date: Mar 8, 2003 Time: 10:46:01 AM
Field Summary | |
protected StackableComponentI |
current
|
protected java.lang.String |
encoding
|
protected java.util.Hashtable |
entities
|
protected NSContext |
namespaces
|
protected java.lang.String |
origin
|
protected java.lang.String |
standalone
|
protected java.lang.String |
version
|
protected boolean |
xmlDecl
|
Constructor Summary | |
Context()
|
Method Summary | |
void |
addNode(StackableComponentI child)
Adds a childless node. |
void |
declarePrefix(java.lang.String prefix,
java.lang.String URI)
Accepts a namespace declaration mapping a prefix to a URI. |
void |
endChild()
Ends a node and adjusts context. |
StackableComponentI |
getCurrent()
Returns the current node. |
java.lang.String |
getEncoding()
Provides access to the encoding information from the XML declaration. |
boolean |
getExplicitXMLDecl()
Identifies whether or not the document included an XML declaration. |
java.lang.String |
getOrigin()
Returns a string identifying the origin of the document. |
StackableComponentI |
getParent()
Returns the component which is the parent of the current node. |
java.lang.String |
getPrefix(java.lang.String URI)
Returns a prefix which currently maps to a particular URI. |
java.lang.String |
getStandalone()
Provides access to the standalone information from the XML declaration. |
java.lang.String |
getUri(java.lang.String prefix)
Returns the URI which currently maps to a particular prefix. |
java.lang.String |
getVersion()
Provides access to the version information from the XML declaration. |
boolean |
isSpace(char c)
Reports whether the character c is whitespace or not. |
static void |
main(java.lang.String[] args)
|
void |
popLevel()
Pops the element level up one to undeclare namespaces whose scope is done. |
void |
pushLevel()
Pushes the element level one deeper for namespace-nesting. |
void |
reset()
clear everything in the namespace stack |
java.lang.String |
resolveEntity(java.lang.String entName)
Resolves an entity, hexRef, or decRef. |
void |
setEncoding(java.lang.String encoding)
Sets the character encoding of XML used by the document, retrieved from the XML declaration. |
void |
setEntity(java.lang.String name,
java.lang.String value)
Establishes an entity name-value relationship. |
void |
setExplicitXMLDecl(boolean happened)
Identifies whether the document contained an explicit XML declaration. |
void |
setOrigin(java.lang.String origin)
Accepts a string identifying the origin of the document. |
void |
setStandalone(java.lang.String standalone)
Sets the value of the standalone declaration, retrieved from the XML declaration. |
void |
setVersion(java.lang.String version)
Sets the version of XML used by the document, retrieved from the XML declaration. |
boolean |
setXMLDeclaration(java.lang.String declaration)
Takes a complete XML declaration for processing |
void |
startChild(StackableComponentI child)
Adds a new node to the stack and adjusts context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String origin
protected java.lang.String version
protected java.lang.String encoding
protected java.lang.String standalone
protected boolean xmlDecl
protected NSContext namespaces
protected StackableComponentI current
protected java.util.Hashtable entities
Constructor Detail |
public Context()
Method Detail |
public void setOrigin(java.lang.String origin)
setOrigin
in interface ContextI
public java.lang.String getOrigin()
getOrigin
in interface ContextI
public boolean setXMLDeclaration(java.lang.String declaration)
setXMLDeclaration
in interface ContextI
declaration
- the complete XML declaration, from to ?>public void setVersion(java.lang.String version)
setVersion
in interface ContextI
version
- public java.lang.String getVersion()
getVersion
in interface ContextI
public void setEncoding(java.lang.String encoding)
setEncoding
in interface ContextI
encoding
- public java.lang.String getEncoding()
getEncoding
in interface ContextI
public void setStandalone(java.lang.String standalone)
setStandalone
in interface ContextI
standalone
- public java.lang.String getStandalone()
getStandalone
in interface ContextI
public void setExplicitXMLDecl(boolean happened)
setExplicitXMLDecl
in interface ContextI
happened
- - true if the document had a decl, false if notpublic boolean getExplicitXMLDecl()
getExplicitXMLDecl
in interface ContextI
public StackableComponentI getParent()
getParent
in interface ContextI
public StackableComponentI getCurrent()
getCurrent
in interface ContextI
public void startChild(StackableComponentI child)
startChild
in interface ContextI
public void endChild()
endChild
in interface ContextI
public void addNode(StackableComponentI child)
addNode
in interface ContextI
public void declarePrefix(java.lang.String prefix, java.lang.String URI)
declarePrefix
in interface NamespaceStackI
public java.lang.String getUri(java.lang.String prefix)
getUri
in interface NamespaceStackI
public java.lang.String getPrefix(java.lang.String URI)
getPrefix
in interface NamespaceStackI
public void pushLevel()
NamespaceStackI
pushLevel
in interface ContextI
public void popLevel()
NamespaceStackI
popLevel
in interface ContextI
public void setEntity(java.lang.String name, java.lang.String value)
ContextI
setEntity
in interface ContextI
name
- name of the entityvalue
- value of the entitypublic java.lang.String resolveEntity(java.lang.String entName)
ContextI
resolveEntity
in interface ContextI
entName
- the name of the entity or ref, minus the & and ;
public boolean isSpace(char c)
isSpace
in interface ContextI
c
- a character to test
public void reset()
NamespaceStackI
reset
in interface ContextI
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |