164 |
/** |
/** |
165 |
* Option "-locale:" Specify the locale charset of Java source files. |
* Option "-locale:" Specify the locale charset of Java source files. |
166 |
*/ |
*/ |
167 |
private String option_locale; |
private Locale option_locale = Locale.getDefault(); |
168 |
|
|
169 |
/** |
/** |
170 |
* Option "-encoding": Specify character encoding of Java source files. |
* Option "-encoding": Specify character encoding of Java source files. |
192 |
* Option "-exclude": list of subpackages to exclude. |
* Option "-exclude": list of subpackages to exclude. |
193 |
*/ |
*/ |
194 |
private List option_exclude = new ArrayList(); |
private List option_exclude = new ArrayList(); |
195 |
|
|
196 |
|
/** |
197 |
|
* Option "-breakiterator" - whether to use BreakIterator for |
198 |
|
* detecting the end of the first sentence. |
199 |
|
*/ |
200 |
|
private boolean option_breakiterator; |
201 |
|
|
202 |
// TODO: add the rest of the options as instance variables |
// TODO: add the rest of the options as instance variables |
203 |
|
|
648 |
|
|
649 |
try |
try |
650 |
{ |
{ |
|
|
|
|
//--- For testing purposes only |
|
|
|
|
|
//System.err.println("getting locale..."); |
|
|
//java.util.Locale loc = java.util.Locale.getDefault(); |
|
|
//System.err.println("locale="+loc.getLanguage()+" |
|
|
// ("+loc.getDefault()+"), "+loc.getLanguage()+", "+loc.getVariant()+", |
|
|
// "+loc.getCountry()); |
|
|
|
|
651 |
//--- Remember current time for profiling purposes |
//--- Remember current time for profiling purposes |
652 |
|
|
653 |
Timer.setStartTime(); |
Timer.setStartTime(); |
1063 |
|
|
1064 |
void process(String[] args) |
void process(String[] args) |
1065 |
{ |
{ |
1066 |
option_locale = args[0]; |
String localeName = args[0]; |
1067 |
System.err.println("WARNING: Unsupported option -locale ignored"); |
String language = null; |
1068 |
|
String country = null; |
1069 |
|
String variant = null; |
1070 |
|
StringTokenizer st = new StringTokenizer(localeName, "_"); |
1071 |
|
if (st.hasMoreTokens()) { |
1072 |
|
language = st.nextToken(); |
1073 |
|
} |
1074 |
|
if (st.hasMoreTokens()) { |
1075 |
|
country = st.nextToken(); |
1076 |
|
} |
1077 |
|
if (st.hasMoreTokens()) { |
1078 |
|
variant = st.nextToken(); |
1079 |
|
} |
1080 |
|
if (variant != null) { |
1081 |
|
option_locale = new Locale(language, country, variant); |
1082 |
|
} |
1083 |
|
else if (country != null) { |
1084 |
|
option_locale = new Locale(language, country); |
1085 |
|
} |
1086 |
|
else if (language != null) { |
1087 |
|
option_locale = new Locale(language); |
1088 |
|
} |
1089 |
|
else { |
1090 |
|
throw new RuntimeException("Illegal locale specification '" |
1091 |
|
+ localeName + "'"); |
1092 |
|
} |
1093 |
} |
} |
1094 |
}); |
}); |
1095 |
options.put("-encoding", new OptionProcessor(2) |
options.put("-encoding", new OptionProcessor(2) |
1100 |
option_encoding = args[0]; |
option_encoding = args[0]; |
1101 |
} |
} |
1102 |
}); |
}); |
1103 |
|
options.put("-breakiterator", new OptionProcessor(1) |
1104 |
|
{ |
1105 |
|
void process(String[] args) |
1106 |
|
{ |
1107 |
|
option_breakiterator = true; |
1108 |
|
} |
1109 |
|
}); |
1110 |
} |
} |
1111 |
|
|
1112 |
/** |
/** |
1207 |
+ " -tagletpath Sets the CLASSPATH to load subsequent Taglets from.\n" |
+ " -tagletpath Sets the CLASSPATH to load subsequent Taglets from.\n" |
1208 |
+ " -subpackages <spkglist> List of subpackages to recursively load\n" |
+ " -subpackages <spkglist> List of subpackages to recursively load\n" |
1209 |
+ " -exclude <pkglist> List of packages to exclude\n" |
+ " -exclude <pkglist> List of packages to exclude\n" |
1210 |
/* + " -breakiterator Compute first sentence with BreakIterator\n" */ |
+ " -breakiterator Compute first sentence with BreakIterator\n" |
1211 |
+ " -docfilessubdirs Enables deep copy of 'doc-files' directories\n" |
+ " -docfilessubdirs Enables deep copy of 'doc-files' directories\n" |
1212 |
+ " -excludedocfilessubdir <name1:name2:...> Excludes 'doc-files' subdirectories with a give name\n" |
+ " -excludedocfilessubdir <name1:name2:...> Excludes 'doc-files' subdirectories with a give name\n" |
1213 |
/* + " -noqualifier all|<packagename1:packagename2:...> Do not qualify package name from ahead of class names\n" */ |
/* + " -noqualifier all|<packagename1:packagename2:...> Do not qualify package name from ahead of class names\n" */ |
1323 |
rootDoc.flush(); |
rootDoc.flush(); |
1324 |
} |
} |
1325 |
|
|
1326 |
|
/** |
1327 |
|
* Return whether the -breakiterator option has been specified. |
1328 |
|
*/ |
1329 |
|
public boolean isUseBreakIterator() |
1330 |
|
{ |
1331 |
|
return this.option_breakiterator; |
1332 |
|
} |
1333 |
|
|
1334 |
|
/** |
1335 |
|
* Return the locale specified using the -locale option or the |
1336 |
|
* default locale; |
1337 |
|
*/ |
1338 |
|
public Locale getLocale() |
1339 |
|
{ |
1340 |
|
return this.option_locale; |
1341 |
|
} |
1342 |
} |
} |
1343 |
|
|