public class SiteCatalogXMLParser3 extends StackBasedXMLParser implements SiteCatalogXMLParser
Modifier and Type | Field and Description |
---|---|
private boolean |
mLoadAll
A boolean indicating whether to load all sites.
|
private SiteStore |
mResult
The final result constructed.
|
private java.util.Set<java.lang.String> |
mSites
The set of sites that need to be parsed.
|
static java.lang.String |
SCHEMA_LOCATION
The "not-so-official" location URL of the Site Catalog Schema.
|
static java.lang.String |
SCHEMA_NAMESPACE
uri namespace
|
mDepth, mParsingDone, mStack
DEFAULT_PARSER_NAME, mAdjFName, mLocator, mLogger, mLogMsg, mParser, mProps, mTextContent, mTextString
Constructor and Description |
---|
SiteCatalogXMLParser3(PegasusBag bag,
java.util.List<java.lang.String> sites)
The overloaded constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
createObject(java.lang.String element,
java.util.List names,
java.util.List values)
Composes the
SiteData object corresponding to the element
name in the XML document. |
java.lang.String |
getSchemaLocation()
Returns the local path to the XML schema against which to validate.
|
java.lang.String |
getSchemaNamespace()
Returns the XML schema namespace that a document being parsed conforms
to.
|
SiteStore |
getSiteStore()
Returns the constructed site store object
|
private boolean |
loadSite(SiteCatalogEntry3 site)
Whether to laod a site or not in the
SiteStore |
static void |
main(java.lang.String[] args) |
boolean |
setElementRelation(java.lang.String childElement,
java.lang.Object parent,
java.lang.Object child)
This method sets the relations between the currently finished XML
element and its containing element in terms of Java objects.
|
void |
startParser(java.lang.String file)
The main method that starts the parsing.
|
attributeNotSupported, complain, endDocument, endElement, log, startElement, unSupportedNestingOfElements
characters, ignoreWhitespace, ignoreWhitespace, setDocumentLocator, setParserFeature, setSchemaLocations, testForFile
public static final java.lang.String SCHEMA_LOCATION
public static final java.lang.String SCHEMA_NAMESPACE
private SiteStore mResult
private java.util.Set<java.lang.String> mSites
private boolean mLoadAll
public SiteCatalogXMLParser3(PegasusBag bag, java.util.List<java.lang.String> sites)
bag
- the bag of initialization objects.sites
- the list of sites that need to be parsed. * means all.public SiteStore getSiteStore()
getSiteStore
in interface SiteCatalogXMLParser
SiteStore if parsing completed
public void startParser(java.lang.String file)
startParser
in class Parser
file
- the XML file to be parsed.public java.lang.Object createObject(java.lang.String element, java.util.List names, java.util.List values)
SiteData
object corresponding to the element
name in the XML document.createObject
in class StackBasedXMLParser
element
- the element name encountered while parsing.names
- is a list of attribute names, as strings.values
- is a list of attribute values, to match the key list.java.lang.IllegalArgumentException
- if the element name is too short.private boolean loadSite(SiteCatalogEntry3 site)
SiteStore
site
- the SiteCatalogEntry
object.public boolean setElementRelation(java.lang.String childElement, java.lang.Object parent, java.lang.Object child)
setElementRelation
in class StackBasedXMLParser
childElement
- name is the the child element nameparent
- is a reference to the parent's Java objectchild
- is the completed child object to connect to the parentpublic java.lang.String getSchemaNamespace()
getSchemaNamespace
in class Parser
public java.lang.String getSchemaLocation()
getSchemaLocation
in class Parser
public static void main(java.lang.String[] args)
args
-