|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectautohit.creator.compiler.XmlCompiler
This is the a base XML compiler. It must be extended by a specific compiler. Users of an extended class will call the compile() method in this class, which will first parse the XML then call the abstract method build(). An extended class must override the build() method and use to to compile from the xml document tree.
This will load/cache the DTD by providing a new Resolver that will return a string reader to the cached DTD. It assumes that each execution of "build" is for a new compile.
WARNING!!! For the compiler to work, the root property must be set and passed in the prop to the constructor.
EPG - Initial - 14Apr03
Field Summary | |
XmlParseErrorHandler |
myErrorHandler
Handles parse/compile errors and warnings. |
AutohitLogInjectorWrapper |
myLog
|
AutohitLogInjectorWrapper |
runtimeLog
Runtime logger. |
Constructor Summary | |
XmlCompiler()
Constructor. |
|
XmlCompiler(java.lang.String dtdURI,
SystemContext sc)
Constructor. |
Method Summary | |
abstract java.lang.Object |
build(org.w3c.dom.Document xd)
Abstract build method. |
java.lang.Object |
compile(java.io.InputStream is)
Compile a stream into object code. |
int |
numberErrors()
Get error count. |
int |
numberWarnings()
Get warning count. |
void |
resetRuntimeLog()
This sets the runtime log back to be the same as the system log. |
void |
runtimeDebug(java.lang.String t)
Posts a debug message to the runtime log. |
void |
runtimeError(java.lang.String t)
Posts a warning to the runtime log and increments the error count. |
void |
runtimeWarning(java.lang.String t)
Posts a warning to the runtime log and increments the error count. |
void |
setRuntimeLog(AutohitLogInjectorWrapper cl)
This sets the runtime log. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public AutohitLogInjectorWrapper runtimeLog
runtimeError(String t)
,
runtimeWarning(String t)
public AutohitLogInjectorWrapper myLog
public XmlParseErrorHandler myErrorHandler
XmlParseErrorHandler
Constructor Detail |
public XmlCompiler(java.lang.String dtdURI, SystemContext sc) throws java.lang.Exception
dtdURI
- URI of the DTD used in the !DOCTYPE * SYSTEM clause in the
compile targets.sc
- A system context containing valid references to a root logger
and the system properties.
java.lang.Exception
- any exception invalidates the compiler.public XmlCompiler() throws AutohitException
Method Detail |
public java.lang.Object compile(java.io.InputStream is)
is
- An input stream to the text that is to be compiled.
public void runtimeWarning(java.lang.String t)
t
- the warning messagepublic void runtimeError(java.lang.String t)
t
- the error messagepublic void runtimeDebug(java.lang.String t)
t
- the debug messagepublic int numberErrors()
public int numberWarnings()
public void setRuntimeLog(AutohitLogInjectorWrapper cl)
cl
- a log injectorpublic void resetRuntimeLog()
public abstract java.lang.Object build(org.w3c.dom.Document xd)
xd
- A parsed XML document.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |