/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** Translates a .properties file into a .java file containing the
* definition of a java.util.Properties subclass which can then be
* compiled with javac. <P>
*
* Usage: java CompileProperties [path to .properties file] [path to .java file to be output] [super class]
*
* Infers the package by looking at the common suffix of the two
* inputs, eliminating "classes" from it.
*
* @author Scott Violet
* @author Kenneth Russell
*/
public class CompileProperties {
if ( !ok ) {
}
}
static interface Log {
}
private boolean quiet = false;
}
if ( e != null ) {
e.printStackTrace();
}
}
}
if (!quiet)
}
};
}
boolean ok = true;
/* Original usage */
ok = false;
} else {
/* New batch usage */
ok = false;
}
/* Need at least one file. */
if ( !ok ) {
} else {
/* Process files */
}
}
}
return ok;
}
boolean ok = true;
if ( compileCount > 0 ) {
supers = new_supers;
} else {
}
compileCount++;
try {
if ( byteCount <= 0 ) {
ok = false;
} else {
ok = false;
}
}
} catch ( IOException e ) {
ok = false;
}
try {
} catch ( IOException e ) {
ok = false;
}
}
}
}
if ( !ok ) {
break;
}
quiet = true;
} else {
ok = false;
}
}
return ok;
}
String superClass) {
boolean ok = true;
Properties p = new Properties();
try {
} catch ( FileNotFoundException e ) {
ok = false;
} catch ( IOException e ) {
ok = false;
}
if ( ok ) {
}
}
// Get class name from java filename, not the properties filename.
// (zh_TW properties might be used to create zh_HK files)
if (dotIndex == -1) {
} else {
}
}
try {
writer = new BufferedWriter(
} catch ( IOException e ) {
ok = false;
}
try {
} catch ( IOException e ) {
ok = false;
}
try {
} catch ( IOException e ) {
ok = false;
}
}
}
return ok;
}
log.info(" java CompileProperties {-compile path_to_properties_file path_to_java_output_file super_class} -or- -optionsfile filename");
log.info(" java CompileProperties -compile test.properties test.java java.util.ListResourceBundle");
}
// This is taken from Properties.saveConvert with changes for Java strings
for(int x=0; x<len; x++) {
switch(aChar) {
break;
break;
break;
break;
break;
default:
} else {
}
}
}
}
}
// Normalize file names
// Split into components
sep = "\\\\";
} else {
}
// Match common names, eliminating first "classes" entry from
// each if present
int inStart = 0;
int i = inEnd;
int j = outEnd;
while (i >= 0 && j >= 0) {
++i;
++j;
break;
}
--i;
--j;
}
result = "";
} else {
++i;
}
inStart = i;
if (i < inEnd) {
}
}
}
return result;
}
"{0}" +
"public final class {1} extends {2} '{'\n" +
" protected final Object[][] getContents() '{'\n" +
" return new Object[][] '{'\n" +
"{3}" +
" };\n" +
" }\n" +
"}\n";
// This comes from Properties
}
// This comes from Properties
private static final char[] hexDigit = {
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
};
// Note: different from that in Properties
}