本文整理汇总了Java中com.sun.tools.javac.util.StringUtils.toLowerCase方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.toLowerCase方法的具体用法?Java StringUtils.toLowerCase怎么用?Java StringUtils.toLowerCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.toLowerCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generalValidOptions
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* This checks for the validity of the options used by the user.
* This works exactly like
* {@link com.sun.javadoc.Doclet#validOptions(String[][],
* DocErrorReporter)}. This will validate the options which are shared
* by our doclets. For example, this method will flag an error using
* the DocErrorReporter if user has used "-nohelp" and "-helpfile" option
* together.
*
* @param options options used on the command line.
* @param reporter used to report errors.
* @return true if all the options are valid.
*/
public boolean generalValidOptions(String options[][],
DocErrorReporter reporter) {
boolean docencodingfound = false;
String encoding = "";
for (int oi = 0; oi < options.length; oi++) {
String[] os = options[oi];
String opt = StringUtils.toLowerCase(os[0]);
if (opt.equals("-docencoding")) {
docencodingfound = true;
if (!checkOutputFileEncoding(os[1], reporter)) {
return false;
}
} else if (opt.equals("-encoding")) {
encoding = os[1];
}
}
if (!docencodingfound && encoding.length() > 0) {
if (!checkOutputFileEncoding(encoding, reporter)) {
return false;
}
}
return true;
}
示例2: addNewSimpleCustomTag
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Add a new <code>SimpleTaglet</code>. If this tag already exists
* and the header passed as an argument is null, move tag to the back of the
* list. If this tag already exists and the header passed as an argument is
* not null, overwrite previous tag with new one. Otherwise, add new
* SimpleTaglet to list.
* @param tagName the name of this tag
* @param header the header to output.
* @param locations the possible locations that this tag
* can appear in.
*/
public void addNewSimpleCustomTag(String tagName, String header, String locations) {
if (tagName == null || locations == null) {
return;
}
Taglet tag = customTags.get(tagName);
locations = StringUtils.toLowerCase(locations);
if (tag == null || header != null) {
customTags.remove(tagName);
customTags.put(tagName, new SimpleTaglet(tagName, header, locations));
if (locations != null && locations.indexOf('x') == -1) {
checkTagName(tagName);
}
} else {
//Move to back
customTags.remove(tagName);
customTags.put(tagName, tag);
}
}
示例3: serialDocInclude
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Return true if the given Doc should be included
* in the serialized form.
*
* @param doc the Doc object to check for serializability.
*/
private static boolean serialDocInclude(Doc doc) {
if (doc.isEnum()) {
return false;
}
Tag[] serial = doc.tags("serial");
if (serial.length > 0) {
String serialtext = StringUtils.toLowerCase(serial[0].text());
if (serialtext.indexOf("exclude") >= 0) {
return false;
} else if (serialtext.indexOf("include") >= 0) {
return true;
}
}
return true;
}
示例4: serialDocInclude
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Return true if the given Doc should be included
* in the serialized form.
*
* @param doc the Doc object to check for serializability.
*/
private static boolean serialDocInclude(Doc doc) {
if (doc.isEnum()) {
return false;
}
Tag[] serial = doc.tags("serial");
if (serial.length > 0) {
String serialtext = StringUtils.toLowerCase(serial[0].text());
if (serialtext.contains("exclude")) {
return false;
} else if (serialtext.contains("include")) {
return true;
}
}
return true;
}
示例5: optionLength
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* This method should be defined in all those doclets
* which want to inherit from this Configuration. This method
* should return the number of arguments to the command line
* option (including the option name). For example,
* -notimestamp is a single-argument option, so this method would
* return 1.
*
* @param option Command line option under consideration.
* @return number of arguments to option (including the
* option name). Zero return means option not known.
* Negative value means error occurred.
*/
public int optionLength(String option) {
option = StringUtils.toLowerCase(option);
if (option.equals("-author") ||
option.equals("-docfilessubdirs") ||
option.equals("-javafx") ||
option.equals("-keywords") ||
option.equals("-linksource") ||
option.equals("-nocomment") ||
option.equals("-nodeprecated") ||
option.equals("-nosince") ||
option.equals("-notimestamp") ||
option.equals("-quiet") ||
option.equals("-xnodate") ||
option.equals("-version")) {
return 1;
} else if (option.equals("-d") ||
option.equals("-docencoding") ||
option.equals("-encoding") ||
option.equals("-excludedocfilessubdir") ||
option.equals("-link") ||
option.equals("-sourcetab") ||
option.equals("-noqualifier") ||
option.equals("-output") ||
option.equals("-sourcepath") ||
option.equals("-tag") ||
option.equals("-taglet") ||
option.equals("-tagletpath") ||
option.equals("-xprofilespath")) {
return 2;
} else if (option.equals("-group") ||
option.equals("-linkoffline")) {
return 3;
} else {
return -1; // indicate we don't know about it
}
}
示例6: SimpleTaglet
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Construct a <code>SimpleTaglet</code>.
* @param tagName the name of this tag
* @param header the header to output.
* @param locations the possible locations that this tag
* can appear in. The <code>String</code> can contain 'p'
* for package, 't' for type, 'm' for method, 'c' for constructor
* and 'f' for field.
*/
public SimpleTaglet(String tagName, String header, String locations) {
this.tagName = tagName;
this.header = header;
locations = StringUtils.toLowerCase(locations);
if (locations.indexOf(ALL) != -1 && locations.indexOf(EXCLUDED) == -1) {
this.locations = PACKAGE + TYPE + FIELD + METHOD + CONSTRUCTOR + OVERVIEW;
} else {
this.locations = locations;
}
}
示例7: encodeAsString
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
public static String encodeAsString(TypeDesc td) {
if (td.typeKind.isPrimitive() || td.typeKind == TypeKind.VOID)
return StringUtils.toLowerCase(td.typeKind.toString());
if (td.typeKind == TypeKind.ARRAY)
return encodeAsString(((ArrayTypeDesc) td).compTypeDesc) + "[]";
if (td.typeKind == TypeKind.TYPEVAR)
return "#" + ((TypeVarTypeDesc) td).identifier;
if (td.typeKind == TypeKind.DECLARED)
return ((ReferenceTypeDesc) td).javaType.toString();
throw new AssertionError("Unhandled type: " + td.typeKind);
}
示例8: optionLength
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* This method should be defined in all those doclets
* which want to inherit from this Configuration. This method
* should return the number of arguments to the command line
* option (including the option name). For example,
* -notimestamp is a single-argument option, so this method would
* return 1.
*
* @param option Command line option under consideration.
* @return number of arguments to option (including the
* option name). Zero return means option not known.
* Negative value means error occurred.
*/
public int optionLength(String option) {
option = StringUtils.toLowerCase(option);
switch (option) {
case "-author":
case "-docfilessubdirs":
case "-javafx":
case "-keywords":
case "-linksource":
case "-nocomment":
case "-nodeprecated":
case "-nosince":
case "-notimestamp":
case "-quiet":
case "-xnodate":
case "-version":
case "-xdaccessinternalapi":
return 1;
case "-d":
case "-docencoding":
case "-encoding":
case "-excludedocfilessubdir":
case "-link":
case "-sourcetab":
case "-noqualifier":
case "-output":
case "-sourcepath":
case "-tag":
case "-taglet":
case "-tagletpath":
return 2;
case "-group":
case "-linkoffline":
return 3;
default:
return -1; // indicate we don't know about it
}
}
示例9: SimpleTaglet
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Construct a <code>SimpleTaglet</code>.
* @param tagName the name of this tag
* @param header the header to output.
* @param locations the possible locations that this tag
* can appear in. The <code>String</code> can contain 'p'
* for package, 't' for type, 'm' for method, 'c' for constructor
* and 'f' for field.
*/
public SimpleTaglet(String tagName, String header, String locations) {
this.tagName = tagName;
this.header = header;
locations = StringUtils.toLowerCase(locations);
if (locations.contains(ALL) && !locations.contains(EXCLUDED)) {
this.locations = PACKAGE + TYPE + FIELD + METHOD + CONSTRUCTOR + OVERVIEW;
} else {
this.locations = locations;
}
}
示例10: getText
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
public String getText() {
return StringUtils.toLowerCase(name());
}
示例11: Flag
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
Flag(long flag) {
this.value = flag;
this.lowercaseName = StringUtils.toLowerCase(name());
}
示例12: isArchive
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/** Is this the name of an archive file? */
private boolean isArchive(File file) {
String n = StringUtils.toLowerCase(file.getName());
return fsInfo.isFile(file)
&& (n.endsWith(".jar") || n.endsWith(".zip"));
}
示例13: setSpecificDocletOptions
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Depending upon the command line options provided by the user, set
* configure the output generation environment.
*
* @param options The array of option names and values.
*/
@Override
public void setSpecificDocletOptions(String[][] options) {
for (int oi = 0; oi < options.length; ++oi) {
String[] os = options[oi];
String opt = StringUtils.toLowerCase(os[0]);
if (opt.equals("-footer")) {
footer = os[1];
} else if (opt.equals("-header")) {
header = os[1];
} else if (opt.equals("-packagesheader")) {
packagesheader = os[1];
} else if (opt.equals("-doctitle")) {
doctitle = os[1];
} else if (opt.equals("-windowtitle")) {
windowtitle = os[1].replaceAll("\\<.*?>", "");
} else if (opt.equals("-top")) {
top = os[1];
} else if (opt.equals("-bottom")) {
bottom = os[1];
} else if (opt.equals("-helpfile")) {
helpfile = os[1];
} else if (opt.equals("-stylesheetfile")) {
stylesheetfile = os[1];
} else if (opt.equals("-charset")) {
charset = os[1];
} else if (opt.equals("-xdocrootparent")) {
docrootparent = os[1];
} else if (opt.equals("-nohelp")) {
nohelp = true;
} else if (opt.equals("-splitindex")) {
splitindex = true;
} else if (opt.equals("-noindex")) {
createindex = false;
} else if (opt.equals("-use")) {
classuse = true;
} else if (opt.equals("-notree")) {
createtree = false;
} else if (opt.equals("-nodeprecatedlist")) {
nodeprecatedlist = true;
} else if (opt.equals("-nonavbar")) {
nonavbar = true;
} else if (opt.equals("-nooverview")) {
nooverview = true;
} else if (opt.equals("-overview")) {
overview = true;
} else if (opt.equals("-xdoclint")) {
doclintOpts.add(null);
} else if (opt.startsWith("-xdoclint:")) {
doclintOpts.add(opt.substring(opt.indexOf(":") + 1));
}
}
if (root.specifiedClasses().length > 0) {
Map<String,PackageDoc> map = new HashMap<String,PackageDoc>();
PackageDoc pd;
ClassDoc[] classes = root.classes();
for (int i = 0; i < classes.length; i++) {
pd = classes[i].containingPackage();
if(! map.containsKey(pd.name())) {
map.put(pd.name(), pd);
}
}
}
setCreateOverview();
setTopFile(root);
if (root instanceof RootDocImpl) {
((RootDocImpl) root).initDocLint(doclintOpts, tagletManager.getCustomTagNames());
}
}
示例14: optionLength
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Returns the "length" of a given option. If an option takes no
* arguments, its length is one. If it takes one argument, it's
* length is two, and so on. This method is called by JavaDoc to
* parse the options it does not recognize. It then calls
* {@link #validOptions(String[][], DocErrorReporter)} to
* validate them.
* <b>Note:</b><br>
* The options arrive as case-sensitive strings. For options that
* are not case-sensitive, use toLowerCase() on the option string
* before comparing it.
* </blockquote>
*
* @return number of arguments + 1 for a option. Zero return means
* option not known. Negative value means error occurred.
*/
public int optionLength(String option) {
int result = -1;
if ((result = super.optionLength(option)) > 0) {
return result;
}
// otherwise look for the options we have added
option = StringUtils.toLowerCase(option);
if (option.equals("-nodeprecatedlist") ||
option.equals("-noindex") ||
option.equals("-notree") ||
option.equals("-nohelp") ||
option.equals("-splitindex") ||
option.equals("-serialwarn") ||
option.equals("-use") ||
option.equals("-nonavbar") ||
option.equals("-nooverview") ||
option.equals("-xdoclint") ||
option.startsWith("-xdoclint:")) {
return 1;
} else if (option.equals("-help")) {
// Uugh: first, this should not be hidden inside optionLength,
// and second, we should not be writing directly to stdout.
// But we have no access to a DocErrorReporter, which would
// allow use of reporter.printNotice
System.out.println(getText("doclet.usage"));
return 1;
} else if (option.equals("-x")) {
// Uugh: first, this should not be hidden inside optionLength,
// and second, we should not be writing directly to stdout.
// But we have no access to a DocErrorReporter, which would
// allow use of reporter.printNotice
System.out.println(getText("doclet.X.usage"));
return 1;
} else if (option.equals("-footer") ||
option.equals("-header") ||
option.equals("-packagesheader") ||
option.equals("-doctitle") ||
option.equals("-windowtitle") ||
option.equals("-top") ||
option.equals("-bottom") ||
option.equals("-helpfile") ||
option.equals("-stylesheetfile") ||
option.equals("-charset") ||
option.equals("-overview") ||
option.equals("-xdocrootparent")) {
return 2;
} else {
return 0;
}
}
示例15: isArchive
import com.sun.tools.javac.util.StringUtils; //导入方法依赖的package包/类
/**
* Is this the name of an archive file?
*/
private boolean isArchive(Path file) {
String n = StringUtils.toLowerCase(file.getFileName().toString());
return fsInfo.isFile(file)
&& (n.endsWith(".jar") || n.endsWith(".zip"));
}