本文整理汇总了Java中com.strobel.core.StringUtilities类的典型用法代码示例。如果您正苦于以下问题:Java StringUtilities类的具体用法?Java StringUtilities怎么用?Java StringUtilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtilities类属于com.strobel.core包,在下文中一共展示了StringUtilities类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: makeWildcard
import com.strobel.core.StringUtilities; //导入依赖的package包/类
public WildcardType makeWildcard(
final FieldTypeSignature superBound,
final FieldTypeSignature extendsBound) {
if (superBound == null || superBound == BottomSignature.make()) {
if (extendsBound == null ||
(extendsBound instanceof SimpleClassTypeSignature &&
StringUtilities.equals("java.lang.Object", (
(SimpleClassTypeSignature) extendsBound)
.getName()))) {
return WildcardType.unbounded();
}
return WildcardType.makeExtends(makeTypeBound(extendsBound));
} else {
return WildcardType.makeSuper(makeTypeBound(superBound));
}
}
开发者ID:Aivean,项目名称:scala-to-java,代码行数:20,代码来源:CoreMetadataFactory.java
示例2: findTypeVariable
import com.strobel.core.StringUtilities; //导入依赖的package包/类
public GenericParameter findTypeVariable(final String name) {
for (int i = _tempScope.size() - 1; i >= 0; i--) {
final GenericParameter genericParameter = _tempScope.get(i);
if (genericParameter != null && StringUtilities.equals
(genericParameter.getName(), name)) {
return genericParameter;
}
}
final IGenericContext scope = getScope();
if (scope != null) {
return scope.findTypeVariable(name);
}
return null;
}
开发者ID:Aivean,项目名称:scala-to-java,代码行数:19,代码来源:CoreMetadataFactory.java
示例3: findInnerClassEntry
import com.strobel.core.StringUtilities; //导入依赖的package包/类
private InnerClassEntry findInnerClassEntry(final String name) {
if (_owner == null) {
return null;
}
final String internalName = name.replace('.', '/');
final SourceAttribute attribute = SourceAttribute.find(AttributeNames
.InnerClasses, _owner.getSourceAttributes());
if (attribute instanceof InnerClassesAttribute) {
final List<InnerClassEntry> entries = ((InnerClassesAttribute)
attribute).getEntries();
for (final InnerClassEntry entry : entries) {
if (StringUtilities.equals(entry.getInnerClassName(),
internalName)) {
return entry;
}
}
}
return null;
}
开发者ID:Aivean,项目名称:scala-to-java,代码行数:24,代码来源:CoreMetadataFactory.java
示例4: formatConstant
import com.strobel.core.StringUtilities; //导入依赖的package包/类
public static String formatConstant(Object constant) {
if(constant instanceof String) {
return StringUtilities.escape((String)constant, true);
}
if(constant instanceof TypeReference) {
return ((TypeReference)constant).getSimpleName()+".class";
}
if(constant instanceof Number) {
return formatValue(constant, FORMAT_PLAIN);
}
return String.valueOf(constant);
}
开发者ID:amaembo,项目名称:huntbugs,代码行数:13,代码来源:Formatter.java
示例5: actionPerformed
import com.strobel.core.StringUtilities; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
tmp_thread = new Thread() {
public void run() {
if (findButton.getText().equals("Stop")) {
if (tmp_thread != null)
tmp_thread.interrupt();
setStatus("Stopped.");
findButton.setText("Find");
} else {
findButton.setText("Stop");
classesList.clear();
ConfigSaver configSaver = ConfigSaver.getLoadedInstance();
DecompilerSettings settings = configSaver.getDecompilerSettings();
File inFile = MainWindow.model.getOpenedFile();
boolean filter = ConfigSaver.getLoadedInstance().getLuytenPreferences()
.isFilterOutInnerClassEntries();
try {
JarFile jfile = new JarFile(inFile);
Enumeration<JarEntry> entLength = jfile.entries();
initProgressBar(Collections.list(entLength).size());
Enumeration<JarEntry> ent = jfile.entries();
while (ent.hasMoreElements() && findButton.getText().equals("Stop")) {
JarEntry entry = ent.nextElement();
String name = entry.getName();
setStatus(name);
if (filter && name.contains("$"))
continue;
if (entry.getName().endsWith(".class")) {
synchronized (settings) {
String internalName = StringUtilities.removeRight(entry.getName(), ".class");
TypeReference type = Model.metadataSystem.lookupType(internalName);
TypeDefinition resolvedType = null;
if (type == null || ((resolvedType = type.resolve()) == null)) {
throw new Exception("Unable to resolve type.");
}
StringWriter stringwriter = new StringWriter();
DecompilationOptions decompilationOptions;
decompilationOptions = new DecompilationOptions();
decompilationOptions.setSettings(settings);
decompilationOptions.setFullDecompilation(true);
PlainTextOutput plainTextOutput = new PlainTextOutput(stringwriter);
plainTextOutput.setUnicodeOutputEnabled(
decompilationOptions.getSettings().isUnicodeOutputEnabled());
settings.getLanguage().decompileType(resolvedType, plainTextOutput,
decompilationOptions);
String decompiledSource = stringwriter.toString().toLowerCase();
if (decompiledSource.contains(textField.getText().toLowerCase())) {
addClassName(entry.getName());
}
}
}
}
setSearching(false);
if (findButton.getText().equals("Stop")) {
setStatus("Done.");
findButton.setText("Find");
}
jfile.close();
} catch (Exception e) {
Luyten.showExceptionDialog("Exception!", e);
}
}
}
};
tmp_thread.start();
}
开发者ID:hsswx7,项目名称:CS4500GroupProject,代码行数:70,代码来源:FindAllBox.java
示例6: formatString
import com.strobel.core.StringUtilities; //导入依赖的package包/类
private static String formatString(String value, String format) {
if (format.equals("const")) {
return StringUtilities.escape(value, true);
}
return value;
}
开发者ID:amaembo,项目名称:huntbugs,代码行数:7,代码来源:Formatter.java
示例7: equiMethods
import com.strobel.core.StringUtilities; //导入依赖的package包/类
private static boolean equiMethods(final MethodReference left, final MethodReference right) {
return StringUtilities.equals(left.getFullName(), right.getFullName()) &&
StringUtilities.equals(left.getErasedSignature(), right.getErasedSignature());
}
开发者ID:amaembo,项目名称:huntbugs,代码行数:5,代码来源:Equi.java
示例8: equiFields
import com.strobel.core.StringUtilities; //导入依赖的package包/类
private static boolean equiFields(final FieldReference left, final FieldReference right) {
return StringUtilities.equals(left.getFullName(), right.getFullName());
}
开发者ID:amaembo,项目名称:huntbugs,代码行数:4,代码来源:Equi.java
注:本文中的com.strobel.core.StringUtilities类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论