@MinDoc(copyright="Copyright 2004, 2005, 2009 A. Weinert", author="Albrecht Weinert", version="V.44", lastModified="6.05.2021", usage="start as Java application (-? for help)", purpose="a demo and introductory application for SAX XML parsers") public class SAXdemo extends App
SAXParser
that is
widely configurable. An input to this application is read and then parsed
by taking the parser's XMLReader
.SAXdemo
does not much useful. The source,
SAXdemo.java, and the
SAXdemo.properties.properties may be a good starting
point for XML applications based on
Frame4J.XMLio
,
XMLdoc
,
XMLconf
,
SAXHandler
ComVar.Impl
Modifier and Type | Field and Description |
---|---|
protected SAXHandler |
handler
The error and content handler.
|
protected Input |
inp
The XML input.
|
Integer |
INT1
Integer 1.
|
boolean |
showCount
Display the frequency of names.
|
boolean |
stopOnError
Stop on errors.
|
protected HashMap<String,Integer> |
tagCounts
Hash table for counting names.
|
protected XMLconf |
xmlConf
Parser's properties.
|
String |
xmlFile
The XML file (or URL); the input.
|
protected XMLReader |
xmlReader
The SAX parser.
|
ano, appBase, appIO, appStartTime, appStartTimeMS, args, argsOrig, bgColor, err, fullClassName, help, icon, log, mainThread, myClass, myFrame, name, out, outMode, packName, prop, retCode, runFlag, shortClassName, title, verbose, verbosity
AUTHOR, BLANK_STRING, cons, CONSOL_ENCODING, COPYRIGHT, D, D_NaN, D_NegInf, D_PosInf, EMPTY_INT_A, EMPTY_STRING, FILE_ENCODING, FRW_CLLD, FS, FSS, H, hasCons, HOST_IP, HOST_IPv4, HOST_NAME, INIT_ERROR, JAR_ENCODING, JH, JOB_DONE_OK, JRL, LOG_OUT_ERROR, M, MAIN_THREAD_EXC, NO_BYTES, NO_CLASSES, NO_DOUBLES, NO_OBJECTS, NO_PARS_ERROR, NO_STRINGS, NOT_WINDOWS, ON_PI, ONE_DAY, ONE_HOUR, ONE_LEAP_YEAR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, ONE_YEAR, OS, PROG_NAME, PROG_SHORT, PS, RUNTIME, S, SHY, UD, UL, UL_UR_da, UR
ILLEGAL_TYPE, ILLEGAL_VALUE, NO_ATTRIBUTE, NO_KNOWN_ATTRIBUTE, NO_VALUE, OK, retVtext
Constructor and Description |
---|
SAXdemo() |
Modifier and Type | Method and Description |
---|---|
protected void |
countName(CharSequence name)
Count a name.
|
int |
doIt()
Working method of SaxDemo.
|
protected boolean |
isHelpLog()
Conditions for help output.
|
static void |
main(String[] args)
Start method of SAXDemo.
|
actionPerformed, allowNoPropertiesFile, clientOrder, condHelpLog, connect, errMeld, errMeld, errorExit, errorExit, errorText, extraPropertiesFile, formMessage, formMessage, formMessage, getAbout, getAboutText, getActTime, getAppLogger, getAppStartTime, getArgs, getAuthor, getCopyright, getDbLogger, getExecTimeMs, getExecTimeMsL, getExecTimeString, getHelp, getHelpText, getIcon, getLanguage, getLogHandler, getMessageComponent, getMessageComponentsLength, getMyFrame, getName, getNameWithVersDate, getOutMode, getProp, getPurpose, getStartTime, getStateString, getTheCloser, getTitle, getUsage, getVerbose, getVerbosity, getVersDate, go, go, go, haveIcon, isDebug, isHelp, isNormal, isRunFlag, isSilent, isTest, isVerbose, logVerbose, logVerbose, makeStatusTextEnd, makeStatusTextStart, messageFormat, normalExit, parsePartial, performeAction, queueAction, regAsStdMBean, repExc, setAboutText, setAttribute, setAttribute, setAuthor, setBgColor, setCodePages, setCopyright, setHelp, setLogOut2, setName, setOutMode, setOutMode, setPurpose, setTitle, setUsage, setVerbose, setVerbose, setVerbosity, setVerbosity, setVersDate, stop, threeLineEndMsg, toString, twoLineEndMsg, twoLineStartMsg, valueLang, valueLang, wakeMainThread
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
retVtext
public boolean showCount
public boolean stopOnError
public String xmlFile
protected XMLconf xmlConf
App.prop
, according to start parameters.protected XMLReader xmlReader
SAXParser
will be made as
XMLReader
by xmlConf
's method
XMLconf.makeXMLReader(SAXHandler)
.SAXHandler
serves as handler
.protected Input inp
protected SAXHandler handler
xmlReader
public final Integer INT1
protected boolean isHelpLog()
xmlFile
is null, additionally to App.help
(by option -? or -help).t.isHelpLog
in class App
App.help
App.isHelp()
,
App.condHelpLog()
public static void main(String[] args)
args
- command line arguments public int doIt()
doIt
in class App
Prop
,
App.go(String[])
,
App.go(String[], String, CharSequence)
,
App.mainThread
protected void countName(CharSequence name)