クラス org.objectweb.cjdbc.common.util.SplitXmlTask

すべてのメンバ一覧

説明

Defines the SplitXml Ant target used to prepare the C-JDBC scripts generation.

作者:
Nicolas Modrzyk
バージョン:
1.0

SplitXmlTask.java43 行で定義されています。

Public メソッド

void execute () throws BuildException
void setScriptXmlFile (String xmlFilePath)
void setOutputDir (String outputDirPath)
void setParsingTagName (String tagName)
void setOuputFileAttribute (String attributeName)

Private 変数

String xmlFilePath
String outputDir
String attributeName
String startTagName
String endTagName


メソッド

void org.objectweb.cjdbc.common.util.SplitXmlTask.execute  )  throws BuildException
 

参照:
org.apache.tools.ant.Task#execute()
SplitXmlTask.java54 行で定義されています。

参照先 org.objectweb.cjdbc.common.util.SplitXmlTask.attributeName, org.objectweb.cjdbc.common.util.SplitXmlTask.endTagName, org.objectweb.cjdbc.common.util.SplitXmlTask.outputDir, org.objectweb.cjdbc.common.util.SplitXmlTask.startTagName, と org.objectweb.cjdbc.common.util.SplitXmlTask.xmlFilePath.

00055 { 00056 try 00057 { 00058 BufferedReader reader = new BufferedReader(new FileReader(xmlFilePath)); 00059 String lineBuffer; 00060 while ((lineBuffer = reader.readLine()) != null) 00061 { 00062 if (lineBuffer.indexOf(startTagName) != -1) 00063 { 00064 //System.out.println(lineBuffer); 00065 int index = lineBuffer.indexOf(attributeName) 00066 + attributeName.length() + 2; 00067 String fileName = lineBuffer.substring(index, lineBuffer.indexOf( 00068 '\"', index)); 00069 BufferedWriter writer = new BufferedWriter(new FileWriter(outputDir 00070 + File.separator + fileName + ".xml")); 00071 writer.write(lineBuffer + System.getProperty("line.separator")); 00072 while ((lineBuffer = reader.readLine()) != null 00073 && lineBuffer.indexOf(endTagName) == -1) 00074 { 00075 writer.write(lineBuffer + System.getProperty("line.separator")); 00076 } 00077 if (lineBuffer != null) // append last line 00078 writer.write(lineBuffer + System.getProperty("line.separator")); 00079 writer.flush(); 00080 writer.close(); 00081 continue; 00082 } 00083 } 00084 } 00085 catch (Exception e) 00086 { 00087 throw new BuildException(e.getMessage()); 00088 } 00089 }

void org.objectweb.cjdbc.common.util.SplitXmlTask.setOuputFileAttribute String  attributeName  ) 
 

Set the attribute that contains the name of the file.

引数:
attributeName the name of the attribute to get the name of the file to write
SplitXmlTask.java130 行で定義されています。
00131 { 00132 this.attributeName = attributeName; 00133 }

void org.objectweb.cjdbc.common.util.SplitXmlTask.setOutputDir String  outputDirPath  ) 
 

Specify the output directory.

引数:
outputDirPath the path to the directory
SplitXmlTask.java106 行で定義されています。

参照先 org.objectweb.cjdbc.common.util.SplitXmlTask.outputDir.

00107 { 00108 this.outputDir = outputDirPath; 00109 File newDir = new File(outputDir); 00110 newDir.mkdirs(); 00111 }

void org.objectweb.cjdbc.common.util.SplitXmlTask.setParsingTagName String  tagName  ) 
 

Set parsing tag name.

引数:
tagName the tag name
SplitXmlTask.java118 行で定義されています。
00119 { 00120 this.startTagName = "<" + tagName + " "; 00121 this.endTagName = "</" + tagName + ">"; 00122 }

void org.objectweb.cjdbc.common.util.SplitXmlTask.setScriptXmlFile String  xmlFilePath  ) 
 

Set the path to the xml path containing the scripts definition.

引数:
xmlFilePath path to the xml file
SplitXmlTask.java96 行で定義されています。
00097 { 00098 this.xmlFilePath = xmlFilePath; 00099 }


変数

String org.objectweb.cjdbc.common.util.SplitXmlTask.attributeName [private]
 

SplitXmlTask.java47 行で定義されています。

参照元 org.objectweb.cjdbc.common.util.SplitXmlTask.execute().

String org.objectweb.cjdbc.common.util.SplitXmlTask.endTagName [private]
 

SplitXmlTask.java49 行で定義されています。

参照元 org.objectweb.cjdbc.common.util.SplitXmlTask.execute().

String org.objectweb.cjdbc.common.util.SplitXmlTask.outputDir [private]
 

SplitXmlTask.java46 行で定義されています。

参照元 org.objectweb.cjdbc.common.util.SplitXmlTask.execute(), と org.objectweb.cjdbc.common.util.SplitXmlTask.setOutputDir().

String org.objectweb.cjdbc.common.util.SplitXmlTask.startTagName [private]
 

SplitXmlTask.java48 行で定義されています。

参照元 org.objectweb.cjdbc.common.util.SplitXmlTask.execute().

String org.objectweb.cjdbc.common.util.SplitXmlTask.xmlFilePath [private]
 

SplitXmlTask.java45 行で定義されています。

参照元 org.objectweb.cjdbc.common.util.SplitXmlTask.execute().


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0.4に対してTue Oct 12 15:16:19 2004に生成されました。 doxygen 1.3.8