|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.structconf.xconf.XconfParser
A parser to parse xconf files.
Nested Class Summary | |
(package private) static class |
XconfParser.CarrierException
|
private class |
XconfParser.Handler
|
Field Summary | |
private URL |
currentFileBeingParsed_
|
static int |
DECLARATION
Use in constructor to instruct parser to parse declarative xconf files. |
private static String |
DEFAULT_SERVICE_PROVIDER_VALUE
|
private URLSet |
fileBookKeeperSet_
|
private boolean |
followReferences_
|
private XconfHandler |
handler_
|
private ParseLocator |
lastLocator_
|
private XconfParser |
outerThis_
|
private int |
parserMode_
|
private int |
platformMode_
|
private Locator |
saxLocator_
|
private static SAXParserFactory |
saxParserFactory__
|
private LinkedList |
serviceProviderStack_
|
static int |
SITE
Use in constructor to instruct parser to parse site specific xconf files. |
private File |
targetBase_
|
private LinkedList |
targetFileStack_
|
static int |
UNIX
Use in constructor to instruct parser to use UNIX default values when a platform specific property default value is encountered. |
static int |
WINDOWS
Use in constructor to instruct parser to use Windows default values when a platform specific property default value is encountered. |
Constructor Summary | |
XconfParser(File target_base,
int parser_mode,
int platform_mode)
Equivalent of this(target, parser_mode, platform_mode, true) . |
|
XconfParser(File target_base,
int parser_mode,
int platform_mode,
boolean follow_references)
|
Method Summary | |
boolean |
currentElementDeclaresTargetFile()
Returns true of the current element declares its own target file instead of inheriting from it's containing elements. |
URL |
getCurrentFileBeingParsed()
|
String |
getCurrentServiceProvider()
|
File |
getCurrentTargetFileCanonicalized()
The appropriate target file based on the current position of the parser in the xconf file hierarchy. |
ParseLocator |
getCurrentTargetFileParseLocation()
The ParseLocator at which the current target file was declared. |
String |
getCurrentTargetFileRelativePath()
The relative path to the which the current target file based on the target root directory. |
File |
getCurrentTargetFileUncanonicalized()
The appropriate target file based on the current position of the parser in the xconf file hierarchy. |
ParseLocator |
getLocator()
|
int |
getMode()
|
private Locator |
getSAXLocator()
|
boolean |
isDeclarationMode()
|
private void |
parse_(URL url)
|
void |
parse(File source_xconf_file)
|
void |
parse(File source_xconf_file,
XconfHandler handler)
|
void |
parse(String source_xconf_url_or_file)
|
void |
parse(String source_xconf_url_or_file,
XconfHandler handler)
|
void |
parse(URL source_xconf_url)
|
void |
parse(URL source_xconf_url,
XconfHandler handler)
|
private void |
popServiceProvider()
|
private void |
popTargetFile()
|
private void |
pushServiceProvider()
|
private void |
pushServiceProvider(String service_provider)
|
private void |
pushTargetFile()
|
private void |
pushTargetFile(String target_file_string)
|
private void |
recurseIntoHrefFor(String qualified_name,
Attributes attributes)
|
void |
setHandler(XconfHandler handler)
|
(package private) static int |
validate(int parser_mode)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String DEFAULT_SERVICE_PROVIDER_VALUE
public static final int DECLARATION
XconfParser(java.io.File, int, int)
,
Constant Field Valuespublic static final int SITE
XconfParser(java.io.File, int, int)
,
Constant Field Valuespublic static final int UNIX
public static final int WINDOWS
private XconfParser outerThis_
private File targetBase_
private static SAXParserFactory saxParserFactory__
private URL currentFileBeingParsed_
private XconfHandler handler_
private LinkedList targetFileStack_
private LinkedList serviceProviderStack_
private final int parserMode_
private final int platformMode_
private final boolean followReferences_
private Locator saxLocator_
private ParseLocator lastLocator_
private URLSet fileBookKeeperSet_
Constructor Detail |
public XconfParser(File target_base, int parser_mode, int platform_mode)
this(target, parser_mode, platform_mode, true)
.
XconfParser(java.io.File,int,int,boolean)
public XconfParser(File target_base, int parser_mode, int platform_mode, boolean follow_references)
target_base
- the root directory which is used in coputing target property files when relative paths are specified in xconf filesparser_mode
- either XconfParser.DECLARATION
or XconfParser.SITE
follow_references
- whether the parser should recurse into included xconf files.
IllegalArgumentException
- if an invalid parser_mode is supplied(note this is an unchecked exception)DECLARATION
,
SITE
Method Detail |
static int validate(int parser_mode)
public int getMode()
XconfParser.DECLARATION
or XconfParser.SITE
DECLARATION
,
SITE
public boolean isDeclarationMode()
public void setHandler(XconfHandler handler)
public final void parse(String source_xconf_url_or_file) throws XconfException
XconfException
public final void parse(String source_xconf_url_or_file, XconfHandler handler) throws XconfException
XconfException
public final void parse(File source_xconf_file) throws XconfException
XconfException
public final void parse(File source_xconf_file, XconfHandler handler) throws XconfException
XconfException
public final void parse(URL source_xconf_url) throws XconfException
XconfException
public final void parse(URL source_xconf_url, XconfHandler handler) throws XconfException
XconfException
public final URL getCurrentFileBeingParsed()
public final String getCurrentTargetFileRelativePath()
#getCurrentTargetFile()
public final File getCurrentTargetFileUncanonicalized()
public final File getCurrentTargetFileCanonicalized()
public final ParseLocator getCurrentTargetFileParseLocation()
#getCurrentTargetFile()
public boolean currentElementDeclaresTargetFile()
private Locator getSAXLocator()
public final ParseLocator getLocator()
private void pushTargetFile(String target_file_string)
private void pushTargetFile()
private void popTargetFile()
public final String getCurrentServiceProvider()
private void pushServiceProvider(String service_provider)
private void pushServiceProvider()
private void popServiceProvider()
private void recurseIntoHrefFor(String qualified_name, Attributes attributes) throws SAXException
SAXException
private void parse_(URL url) throws SAXException
SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |