本文整理汇总了Java中sun.tools.java.Identifier.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Identifier.equals方法的具体用法?Java Identifier.equals怎么用?Java Identifier.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.tools.java.Identifier
的用法示例。
在下文中一共展示了Identifier.equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSpecial
import sun.tools.java.Identifier; //导入方法依赖的package包/类
private static boolean isSpecial(sun.tools.java.Type type,
ClassDefinition theClass,
ContextStack stack) {
if (type.isType(TC_CLASS)) {
Identifier id = type.getClassName();
if (id.equals(idRemote)) return true;
if (id == idJavaIoSerializable) return true;
if (id == idJavaIoExternalizable) return true;
if (id == idCorbaObject) return true;
if (id == idIDLEntity) return true;
BatchEnvironment env = stack.getEnv();
try {
if (env.defCorbaObject.implementedBy(env,theClass.getClassDeclaration())) return true;
} catch (ClassNotFound e) {
classNotFound(stack,e);
}
}
return false;
}
示例2: initialize
import sun.tools.java.Identifier; //导入方法依赖的package包/类
private boolean initialize(sun.tools.java.Type type, ContextStack stack) {
int typeCode = TYPE_NONE;
Identifier id = null;
String idlName = null;
String[] idlModuleName = null;
boolean constant = stack.size() > 0 && stack.getContext().isConstant();
if (type.isType(TC_CLASS)) {
id = type.getClassName();
if (id.equals(idRemote)) {
typeCode = TYPE_JAVA_RMI_REMOTE;
idlName = IDL_JAVA_RMI_REMOTE;
idlModuleName = IDL_JAVA_RMI_MODULE;
} else if (id == idJavaIoSerializable) {
typeCode = TYPE_ANY;
idlName = IDL_SERIALIZABLE;
idlModuleName = IDL_JAVA_IO_MODULE;
} else if (id == idJavaIoExternalizable) {
typeCode = TYPE_ANY;
idlName = IDL_EXTERNALIZABLE;
idlModuleName = IDL_JAVA_IO_MODULE;
} else if (id == idIDLEntity) {
typeCode = TYPE_ANY;
idlName = IDL_IDLENTITY;
idlModuleName = IDL_ORG_OMG_CORBA_PORTABLE_MODULE;
} else {
typeCode = TYPE_CORBA_OBJECT;
// Is it exactly org.omg.CORBA.Object?
if (id == idCorbaObject) {
// Yes, so special case...
idlName = IDLNames.getTypeName(typeCode,constant);
idlModuleName = null;
} else {
// No, so get the correct names...
try {
// These can fail if we get case-sensitive name matches...
idlName = IDLNames.getClassOrInterfaceName(id,env);
idlModuleName = IDLNames.getModuleNames(id,isBoxed(),env);
} catch (Exception e) {
failedConstraint(7,false,stack,id.toString(),e.getMessage());
throw new CompilerError("");
}
}
}
}
if (typeCode == TYPE_NONE) {
return false;
}
// Reset type code...
setTypeCode(typeCode | TM_SPECIAL_INTERFACE | TM_INTERFACE | TM_COMPOUND);
// Set names
if (idlName == null) {
throw new CompilerError("Not a special type");
}
setNames(id,idlModuleName,idlName);
// Initialize CompoundType...
return initialize(null,null,null,stack,false);
}