|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.structconf.migrate.MigratePropsToXconf
Tool to convert exsiting .properties files to .xconf files.
Usage:
java com.ptc.windchill.structconf.migrate.MigratePropsToXconf {-m|-mine} property-files (space separated)
For each property file specified create an xconf file containing its XML representation. The migrator will do its best to preserve formatting of all comments.
Field Summary | |
private static String |
CONSPICUOUS_BAR
|
private boolean |
isSiteFile_
|
private File |
propertiesFile_
|
private HashMap |
serviceEntryElements_
|
private HashMap |
serviceEntryOptionExtraComments_
|
private HashMap |
serviceResourceCache_
|
Constructor Summary | |
MigratePropsToXconf(File properties_file,
boolean is_site_file)
Create an instance to generate an xconf file for the specified properties file. |
Method Summary | |
private void |
addDoNotModifyComment(Element root)
|
private String |
cleanup(String str)
Trim the string and remove lines that contain multiple ###, ===, or --- as line separators. |
private void |
clearCaches()
|
void |
convert()
Convert the properties file to it's corresponding xconf format. |
private void |
convertPropsToDom(Document doc)
An ugly method that does the conversion from property file to DOM. |
private ArrayList |
getOptionsFor(ServiceOrResourceEntryKey key)
Get an array to store all the optional implementations for a service or resource. |
static void |
main(String[] args)
Main entry point. |
private Document |
newDoc()
Create a new DOM Document instance. |
private static void |
showHelp(String error_message)
|
private void |
writeXconfFile(Document doc,
File file)
Output the given DOM document to the file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private File propertiesFile_
private boolean isSiteFile_
private HashMap serviceResourceCache_
private HashMap serviceEntryElements_
private HashMap serviceEntryOptionExtraComments_
private static final String CONSPICUOUS_BAR
Constructor Detail |
public MigratePropsToXconf(File properties_file, boolean is_site_file)
Method Detail |
private void clearCaches()
public void convert() throws IOException, ParserConfigurationException, TransformerConfigurationException, TransformerException
This method is threadsafe within a single process. Note this signature will change to consolidate these exceptions into a single exception or two.
IllegalArgumentException
- if the file is a directory
FileNotFoundException
- if the specified file cannot be located.
IOException
- if there's a problem reading the properties file or writing the xconf file
IllegalArgumentException
- if the file is a directory
ParserConfigurationException
- if a JAXP document builder cannot be created
TransformerConfigurationException
- if a JAXP transformer factory or transformer cannot be created
TransformerException
- if there's a problem converting the XML DOM to a stream via an XSLT identity transformprivate ArrayList getOptionsFor(ServiceOrResourceEntryKey key)
private void convertPropsToDom(Document doc) throws IOException
IOException
private void addDoNotModifyComment(Element root)
private String cleanup(String str)
private Document newDoc() throws ParserConfigurationException
ParserConfigurationException
- if there's no valid JAXP DocumentBuilder implementation.private void writeXconfFile(Document doc, File file) throws TransformerConfigurationException, TransformerException
TransformerConfigurationException
- if a JAXP transformer factory or transformer cannot be created
TransformerException
- if there's a problem converting the XML DOM to a stream via an XSLT identity transformprivate static void showHelp(String error_message)
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |