| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.6.0) on Fri Oct 16 14:57:53 EDT 2009 --> |
| <TITLE> |
| PackageRenamer (EclipseLink 1.2.0, build 'v20091016-r5565' API Reference) |
| </TITLE> |
| |
| <META NAME="date" CONTENT="2009-10-16"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="PackageRenamer (EclipseLink 1.2.0, build 'v20091016-r5565' API Reference)"; |
| } |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| <HR> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| EclipseLink 1.2.0, build 'v20091016-r5565' API Reference</EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| <A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.PackageRenamerException.html" title="class in org.eclipse.persistence.tools"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?org/eclipse/persistence/tools/PackageRenamer.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="PackageRenamer.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.eclipse.persistence.tools</FONT> |
| <BR> |
| Class PackageRenamer</H2> |
| <PRE> |
| java.lang.Object |
| <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.eclipse.persistence.tools.PackageRenamer</B> |
| </PRE> |
| <HR> |
| <DL> |
| <DT><PRE>public class <B>PackageRenamer</B><DT>extends java.lang.Object</DL> |
| </PRE> |
| |
| <P> |
| This class performs package renaming. It demonstrates the following: |
| |
| a) Reading the properties file to be a reference for changing the package |
| name from your source code. |
| |
| b) Traverse source root directory for creating a corresponding output directory |
| and finding the java source file(s) to be changing the package name. |
| |
| c) Search and replace the old TopLink package name(s) with new one(s) according to the reference. |
| |
| You will be able to see the logging message at the command line window |
| where the PackageRenamer is running. |
| <P> |
| |
| <P> |
| <HR> |
| |
| <P> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| |
| <A NAME="nested_class_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Nested Class Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> class</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.PackageRenamerException.html" title="class in org.eclipse.persistence.tools">PackageRenamer.PackageRenamerException</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| <!-- =========== FIELD SUMMARY =========== --> |
| |
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Field Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#SYSTEM_OUT">SYSTEM_OUT</A></B></CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| |
| <A NAME="constructor_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Constructor Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#PackageRenamer()">PackageRenamer</A></B>()</CODE> |
| |
| <BR> |
| The constructor of a PackageRenamer class.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#PackageRenamer(java.lang.String)">PackageRenamer</A></B>(java.lang.String propertiesFileName)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#PackageRenamer(java.lang.String[])">PackageRenamer</A></B>(java.lang.String[] args)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#bannerText()">bannerText</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#binaryCopy(java.io.File, java.io.File)">binaryCopy</A></B>(java.io.File inFile, |
| java.io.File outFile)</CODE> |
| |
| <BR> |
| Do a binary copy of the file byte buffer by byte buffer.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#bufferContainsNullChar(byte[], int)">bufferContainsNullChar</A></B>(byte[] buffer, |
| int bufferLength)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.io.File</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#buildAndCheckDestinationFile(java.lang.String)">buildAndCheckDestinationFile</A></B>(java.lang.String aDirString)</CODE> |
| |
| <BR> |
| INTERNAL</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.io.File</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#buildAndCheckExistingDirFile(java.lang.String)">buildAndCheckExistingDirFile</A></B>(java.lang.String aDirString)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.io.PrintWriter</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#buildAndCheckLogWriter(java.lang.String)">buildAndCheckLogWriter</A></B>(java.lang.String logFileString)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#cleanup()">cleanup</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#createDestinationDirectory(java.io.File)">createDestinationDirectory</A></B>(java.io.File aDirectory)</CODE> |
| |
| <BR> |
| This method creates an output directory for post-rename file(s).</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#directoryIsSubdirectory(java.io.File, java.io.File)">directoryIsSubdirectory</A></B>(java.io.File directory1, |
| java.io.File directory2)</CODE> |
| |
| <BR> |
| Return true if directory2 is contained within directory1.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.io.File</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#existingDirectoryFromPrompt()">existingDirectoryFromPrompt</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#getDefaultPropertiesFileName()">getDefaultPropertiesFileName</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.io.BufferedReader</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#getReader()">getReader</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#isExtensionSupported(java.lang.String)">isExtensionSupported</A></B>(java.lang.String extension)</CODE> |
| |
| <BR> |
| Return true if the PackageRenamer should work on the given file extension.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#logln(java.lang.String)">logln</A></B>(java.lang.String str)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE> |
| |
| <BR> |
| Main method to run the PackageRenamer</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#parseFileExtension(java.io.File)">parseFileExtension</A></B>(java.io.File aFile)</CODE> |
| |
| <BR> |
| Returns the extension of the given file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected java.io.File</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#promptForDestinationDirectory()">promptForDestinationDirectory</A></B>()</CODE> |
| |
| <BR> |
| INTERNAL |
| Prompt from System.in for an empty or non-existent directory to use as the destination directory.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.util.Properties</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#readChangesFile(java.lang.String)">readChangesFile</A></B>(java.lang.String filename)</CODE> |
| |
| <BR> |
| This readChangesFile() method reads the given properties file to be a reference |
| for renaming TopLink package name.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#replace(java.lang.String, java.lang.String, java.lang.String)">replace</A></B>(java.lang.String str, |
| java.lang.String oldChars, |
| java.lang.String newChars)</CODE> |
| |
| <BR> |
| Do a search and replace in a string.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> java.lang.String</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#returnNewFileNameIfRequired(java.lang.String)">returnNewFileNameIfRequired</A></B>(java.lang.String aSourceFileNameWithoutRoot)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#run()">run</A></B>()</CODE> |
| |
| <BR> |
| This run() method performs, |
| reading the properties file into properties variable to be a reference for changing package name.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#runSearchAndReplacePackageName(java.io.File)">runSearchAndReplacePackageName</A></B>(java.io.File sourceFile)</CODE> |
| |
| <BR> |
| This runSearchAndReplacePackageName() reads an pre-rename source file all into string variable and |
| replacing the old package names with the new ones according to the properties file.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected java.io.PrintWriter</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#streamForNonExistentFilePrompt()">streamForNonExistentFilePrompt</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#traverseSourceDirectory(java.io.File)">traverseSourceDirectory</A></B>(java.io.File aDirectoryString)</CODE> |
| |
| <BR> |
| This traverseSourceDirectory() traverse source-root-directory, creating an corresponding output directory, |
| and calling another method for replacing old TopLink package name.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>static void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.html#usage()">usage</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ FIELD DETAIL =========== --> |
| |
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Field Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="SYSTEM_OUT"><!-- --></A><H3> |
| SYSTEM_OUT</H3> |
| <PRE> |
| protected static final java.lang.String <B>SYSTEM_OUT</B></PRE> |
| <DL> |
| <DL> |
| <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.persistence.tools.PackageRenamer.SYSTEM_OUT">Constant Field Values</A></DL> |
| </DL> |
| |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| |
| <A NAME="constructor_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Constructor Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="PackageRenamer()"><!-- --></A><H3> |
| PackageRenamer</H3> |
| <PRE> |
| public <B>PackageRenamer</B>()</PRE> |
| <DL> |
| <DD>The constructor of a PackageRenamer class. |
| <P> |
| </DL> |
| <HR> |
| |
| <A NAME="PackageRenamer(java.lang.String)"><!-- --></A><H3> |
| PackageRenamer</H3> |
| <PRE> |
| public <B>PackageRenamer</B>(java.lang.String propertiesFileName)</PRE> |
| <DL> |
| </DL> |
| <HR> |
| |
| <A NAME="PackageRenamer(java.lang.String[])"><!-- --></A><H3> |
| PackageRenamer</H3> |
| <PRE> |
| public <B>PackageRenamer</B>(java.lang.String[] args)</PRE> |
| <DL> |
| </DL> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="bannerText()"><!-- --></A><H3> |
| bannerText</H3> |
| <PRE> |
| protected java.lang.String <B>bannerText</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="binaryCopy(java.io.File, java.io.File)"><!-- --></A><H3> |
| binaryCopy</H3> |
| <PRE> |
| public void <B>binaryCopy</B>(java.io.File inFile, |
| java.io.File outFile) |
| throws java.io.FileNotFoundException, |
| java.io.IOException</PRE> |
| <DL> |
| <DD>Do a binary copy of the file byte buffer by byte buffer. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.FileNotFoundException</CODE> |
| <DD><CODE>java.io.IOException</CODE></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="bufferContainsNullChar(byte[], int)"><!-- --></A><H3> |
| bufferContainsNullChar</H3> |
| <PRE> |
| protected boolean <B>bufferContainsNullChar</B>(byte[] buffer, |
| int bufferLength)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="buildAndCheckDestinationFile(java.lang.String)"><!-- --></A><H3> |
| buildAndCheckDestinationFile</H3> |
| <PRE> |
| public java.io.File <B>buildAndCheckDestinationFile</B>(java.lang.String aDirString)</PRE> |
| <DL> |
| <DD>INTERNAL |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="buildAndCheckExistingDirFile(java.lang.String)"><!-- --></A><H3> |
| buildAndCheckExistingDirFile</H3> |
| <PRE> |
| public java.io.File <B>buildAndCheckExistingDirFile</B>(java.lang.String aDirString)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="buildAndCheckLogWriter(java.lang.String)"><!-- --></A><H3> |
| buildAndCheckLogWriter</H3> |
| <PRE> |
| public java.io.PrintWriter <B>buildAndCheckLogWriter</B>(java.lang.String logFileString)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="cleanup()"><!-- --></A><H3> |
| cleanup</H3> |
| <PRE> |
| protected void <B>cleanup</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="createDestinationDirectory(java.io.File)"><!-- --></A><H3> |
| createDestinationDirectory</H3> |
| <PRE> |
| public void <B>createDestinationDirectory</B>(java.io.File aDirectory)</PRE> |
| <DL> |
| <DD>This method creates an output directory for post-rename file(s). |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="directoryIsSubdirectory(java.io.File, java.io.File)"><!-- --></A><H3> |
| directoryIsSubdirectory</H3> |
| <PRE> |
| public static boolean <B>directoryIsSubdirectory</B>(java.io.File directory1, |
| java.io.File directory2)</PRE> |
| <DL> |
| <DD>Return true if directory2 is contained within directory1. Both directories must be absolute. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="existingDirectoryFromPrompt()"><!-- --></A><H3> |
| existingDirectoryFromPrompt</H3> |
| <PRE> |
| public java.io.File <B>existingDirectoryFromPrompt</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getDefaultPropertiesFileName()"><!-- --></A><H3> |
| getDefaultPropertiesFileName</H3> |
| <PRE> |
| public static java.lang.String <B>getDefaultPropertiesFileName</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getReader()"><!-- --></A><H3> |
| getReader</H3> |
| <PRE> |
| public java.io.BufferedReader <B>getReader</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="isExtensionSupported(java.lang.String)"><!-- --></A><H3> |
| isExtensionSupported</H3> |
| <PRE> |
| public boolean <B>isExtensionSupported</B>(java.lang.String extension)</PRE> |
| <DL> |
| <DD>Return true if the PackageRenamer should work on the given file extension. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="logln(java.lang.String)"><!-- --></A><H3> |
| logln</H3> |
| <PRE> |
| public void <B>logln</B>(java.lang.String str)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="main(java.lang.String[])"><!-- --></A><H3> |
| main</H3> |
| <PRE> |
| public static void <B>main</B>(java.lang.String[] args)</PRE> |
| <DL> |
| <DD>Main method to run the PackageRenamer |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="parseFileExtension(java.io.File)"><!-- --></A><H3> |
| parseFileExtension</H3> |
| <PRE> |
| public java.lang.String <B>parseFileExtension</B>(java.io.File aFile)</PRE> |
| <DL> |
| <DD>Returns the extension of the given file. Returns and empty string if none was found. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="promptForDestinationDirectory()"><!-- --></A><H3> |
| promptForDestinationDirectory</H3> |
| <PRE> |
| protected java.io.File <B>promptForDestinationDirectory</B>()</PRE> |
| <DL> |
| <DD>INTERNAL |
| Prompt from System.in for an empty or non-existent directory to use as the destination directory. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="readChangesFile(java.lang.String)"><!-- --></A><H3> |
| readChangesFile</H3> |
| <PRE> |
| public java.util.Properties <B>readChangesFile</B>(java.lang.String filename)</PRE> |
| <DL> |
| <DD>This readChangesFile() method reads the given properties file to be a reference |
| for renaming TopLink package name. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="run()"><!-- --></A><H3> |
| run</H3> |
| <PRE> |
| public void <B>run</B>()</PRE> |
| <DL> |
| <DD>This run() method performs, |
| reading the properties file into properties variable to be a reference for changing package name. |
| creating an destination-root-direetory. |
| and, calling traverseSourceDirectory() method. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="streamForNonExistentFilePrompt()"><!-- --></A><H3> |
| streamForNonExistentFilePrompt</H3> |
| <PRE> |
| protected java.io.PrintWriter <B>streamForNonExistentFilePrompt</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="runSearchAndReplacePackageName(java.io.File)"><!-- --></A><H3> |
| runSearchAndReplacePackageName</H3> |
| <PRE> |
| public void <B>runSearchAndReplacePackageName</B>(java.io.File sourceFile)</PRE> |
| <DL> |
| <DD>This runSearchAndReplacePackageName() reads an pre-rename source file all into string variable and |
| replacing the old package names with the new ones according to the properties file. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="replace(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3> |
| replace</H3> |
| <PRE> |
| public static java.lang.String <B>replace</B>(java.lang.String str, |
| java.lang.String oldChars, |
| java.lang.String newChars)</PRE> |
| <DL> |
| <DD>Do a search and replace in a string. |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>the modified String</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="returnNewFileNameIfRequired(java.lang.String)"><!-- --></A><H3> |
| returnNewFileNameIfRequired</H3> |
| <PRE> |
| public java.lang.String <B>returnNewFileNameIfRequired</B>(java.lang.String aSourceFileNameWithoutRoot)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="traverseSourceDirectory(java.io.File)"><!-- --></A><H3> |
| traverseSourceDirectory</H3> |
| <PRE> |
| public void <B>traverseSourceDirectory</B>(java.io.File aDirectoryString)</PRE> |
| <DL> |
| <DD>This traverseSourceDirectory() traverse source-root-directory, creating an corresponding output directory, |
| and calling another method for replacing old TopLink package name. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="usage()"><!-- --></A><H3> |
| usage</H3> |
| <PRE> |
| public static void <B>usage</B>()</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| EclipseLink 1.2.0, build 'v20091016-r5565' API Reference</EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| PREV CLASS |
| <A HREF="../../../../org/eclipse/persistence/tools/PackageRenamer.PackageRenamerException.html" title="class in org.eclipse.persistence.tools"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?org/eclipse/persistence/tools/PackageRenamer.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="PackageRenamer.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| |
| </BODY> |
| </HTML> |