public class XmlJzCfgAnalyzer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
XmlJzCfgAnalyzer.AttribRead |
private static class |
XmlJzCfgAnalyzer.CmdArgs |
(package private) static class |
XmlJzCfgAnalyzer.XmlStructureData |
(package private) static class |
XmlJzCfgAnalyzer.XmlStructureNode
This class is one node for one element to store the structure of a XML file via
XmlJzReader . |
Modifier and Type | Field and Description |
---|---|
(package private) java.util.TreeMap<java.lang.String,XmlJzCfgAnalyzer.XmlStructureData.CfgSubtreeType> |
allElementTypes |
(package private) XmlCfg |
cfgData |
(package private) XmlCfg |
cfgGiven |
(package private) int |
debugStopLineXmlInp |
(package private) LogMessage |
log |
static java.lang.String |
version
Version, License and History:
2024-05-25 Hartmut:
XXXreadNode(BufferedReader, String) etc. seems to be unnecessary. |
(package private) XmlJzCfgAnalyzer.XmlStructureData |
xmlStructData
The common structure data of the read XML file.
|
(package private) XmlJzCfgAnalyzer.XmlStructureNode |
xmlStructTree
The tree of the structure of the read XML file.
|
Constructor and Description |
---|
XmlJzCfgAnalyzer() |
Modifier and Type | Method and Description |
---|---|
private void |
addWrNode(XmlNode wrCfgXmlNode,
XmlJzCfgAnalyzer.XmlStructureNode structNode,
int recursion)
Adds the node and recursively all sub nodes from
XmlJzCfgAnalyzer.XmlStructureNode
It is invoked after a XML file war read with XmlCfg#newCfgReadStruct() |
static int |
amain(XmlJzCfgAnalyzer.CmdArgs args)
Reads a XML file and writes its structure as cfg.xml to help creating a config for the XmlJzReader
|
private void |
checkStructTree()
Checks the read XML structure tree.
|
static void |
main(java.lang.String[] sArgs) |
static XmlCfg |
newCfgReadStruct()
Creates the configuration to read any xml file to store its structure especially in
XmlJzCfgAnalyzer.XmlStructureNode . |
void |
readXmlStruct(java.io.File fXmlIn)
Reads any XML file and stores the structure in the
xmlStructTree . |
XmlCfg |
readXmlStructZip(java.io.File fXmlIn,
java.lang.String pathInZip)
Reads any XML file and stores the structure in the
xmlStructTree . |
void |
setDebugStop(int line)
Only for internal debug.
|
static int |
smain(java.lang.String[] sArgs,
java.lang.Appendable logHelp,
java.lang.Appendable logError)
main gets the arguments as String,
but does not catch unexpected exceptions and does not System.exit(...), use it to execute in a Java environment.
|
private void |
storeCfgNode(XmlCfg.XmlCfgNode dst,
XmlJzCfgAnalyzer.XmlStructureNode src,
boolean bRoot,
int recursion) |
private void |
storeInCfg(XmlJzReader xmlReader) |
void |
writeCfgTemplate(java.io.File wrCfg)
Writes the config file for the XmlJzReader with config file.
|
void |
writeCfgText(java.io.File fout)
Writes the config file for the XmlJzReader with config file.
|
void |
writeData(java.io.File fout) |
private void |
wrSetAddContentAttrib(XmlJzCfgAnalyzer.XmlStructureNode structNode,
XmlNode wrCfgXmlNode) |
private char |
XXXreadAttributeOrSubnode(java.lang.String sLine) |
void |
XXXreadConfigText(java.io.File fin) |
private void |
XXXreadNameSpace(java.lang.String sLine) |
private XmlJzCfgAnalyzer.XmlStructureNode |
XXXreadNode(java.io.BufferedReader rd,
java.lang.String sLine1) |
private void |
XXXreadRootStructure(java.lang.String sLine) |
public static final java.lang.String version
XXXreadNode(BufferedReader, String)
etc. seems to be unnecessary.
XmlJzCfgAnalyzer.CmdArgs
now. Not ready for all.
XmlCfg
.
GenXmlCfgJavaData
.
int debugStopLineXmlInp
LogMessage log
final XmlJzCfgAnalyzer.XmlStructureData xmlStructData
XmlJzCfgAnalyzer.XmlStructureNode xmlStructTree
XmlJzCfgAnalyzer.XmlStructureNode.addElement(String)
.java.util.TreeMap<java.lang.String,XmlJzCfgAnalyzer.XmlStructureData.CfgSubtreeType> allElementTypes
XmlCfg cfgData
XmlCfg cfgGiven
public static void main(java.lang.String[] sArgs)
public static int smain(java.lang.String[] sArgs, java.lang.Appendable logHelp, java.lang.Appendable logError) throws java.io.IOException
sArgs
- java.io.IOException
java.lang.Exception
- if unexpected.public static int amain(XmlJzCfgAnalyzer.CmdArgs args)
args
- pathfileIn.xml pathfileOutcfg.xmlpublic static XmlCfg newCfgReadStruct()
XmlJzCfgAnalyzer.XmlStructureNode
.public void setDebugStop(int line)
line
- public void writeCfgTemplate(java.io.File wrCfg)
wrCfg
- the output file.public void writeCfgText(java.io.File fout)
wrCfg
- the output file.public void XXXreadConfigText(java.io.File fin)
private void XXXreadNameSpace(java.lang.String sLine)
private XmlJzCfgAnalyzer.XmlStructureNode XXXreadNode(java.io.BufferedReader rd, java.lang.String sLine1) throws java.io.IOException
java.io.IOException
private char XXXreadAttributeOrSubnode(java.lang.String sLine)
private void XXXreadRootStructure(java.lang.String sLine)
private void wrSetAddContentAttrib(XmlJzCfgAnalyzer.XmlStructureNode structNode, XmlNode wrCfgXmlNode) throws XmlException
XmlException
private void addWrNode(XmlNode wrCfgXmlNode, XmlJzCfgAnalyzer.XmlStructureNode structNode, int recursion) throws XmlException
XmlJzCfgAnalyzer.XmlStructureNode
It is invoked after a XML file war read with XmlCfg#newCfgReadStruct()
wrCfgXmlNode
- The xml node for output to add.structNode
- The node from the structure of the read XML file,recursion
- decremented, exception on <=0XmlException
- on XML error, IllegalArgumentException on recursion error.public void readXmlStruct(java.io.File fXmlIn) throws java.io.IOException
xmlStructTree
.fXmlIn
- java.io.IOException
public XmlCfg readXmlStructZip(java.io.File fXmlIn, java.lang.String pathInZip) throws java.io.IOException
xmlStructTree
.fXmlIn
- java.io.IOException
private void checkStructTree()
allElementTypes
.
That entries knows all XmlStructNode occurrences.
If a XmlStructNode is used in several constellations (more as one time found, different parent),
then an entry in cfgData
XmlCfg.subtrees
will be created to mark, it is an candidate for SUBTREE.
The SUBTREE in cfgData
is then filled in storeInCfg(XmlJzReader)
.private void storeInCfg(XmlJzReader xmlReader)
private void storeCfgNode(XmlCfg.XmlCfgNode dst, XmlJzCfgAnalyzer.XmlStructureNode src, boolean bRoot, int recursion) throws java.text.ParseException
java.text.ParseException
public void writeData(java.io.File fout) throws java.io.IOException
java.io.IOException