本文整理汇总了Java中sun.tools.java.Identifier类的典型用法代码示例。如果您正苦于以下问题:Java Identifier类的具体用法?Java Identifier怎么用?Java Identifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Identifier类属于sun.tools.java包,在下文中一共展示了Identifier类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setNames
import sun.tools.java.Identifier; //导入依赖的package包/类
/**
* Set name and package. May only be called during initialization.
*/
protected void setNames(Identifier id, String[] idlModuleNames, String idlName) {
this.id = id;
name = Names.mangleClass(id).getName().toString();
packageName = null;
if (id.isQualified()) {
packageName = id.getQualifier().toString();
qualifiedName = packageName + NAME_SEPARATOR + name;
} else {
qualifiedName = name;
}
setIDLNames(idlModuleNames,idlName);
}
示例3: write_tie_thisObject_method
import sun.tools.java.Identifier; //导入依赖的package包/类
public void write_tie_thisObject_method(IndentingWriter p,
Identifier idCorbaObject)
throws IOException
{
if(POATie){
p.plnI("public " + idCorbaObject + " thisObject() {");
/*
p.pln("org.omg.CORBA.Object objref = null;");
p.pln("try{");
p.pln("objref = _poa().servant_to_reference(this);");
p.pln("}catch (org.omg.PortableServer.POAPackage.WrongPolicy exception){");
catchWrongPolicy(p);
p.pln("}catch (org.omg.PortableServer.POAPackage.ServantNotActive exception){");
catchServantNotActive(p);
p.pln("}");
p.pln("return objref;");
*/
p.pln("return _this_object();");
p.pOln("}");
} else {
p.plnI("public " + idCorbaObject + " thisObject() {");
p.pln("return this;");
p.pOln("}");
}
}
示例4: PrimitiveType
import sun.tools.java.Identifier; //导入依赖的package包/类
/**
* IDL_Naming
* Create an PrimitiveType instance for the given class.
*/
private PrimitiveType(ContextStack stack, int typeCode) {
super(stack,typeCode | TM_PRIMITIVE);
// Validate type and set names...
String idlName = IDLNames.getTypeName(typeCode,false);
Identifier id = null;
switch (typeCode) {
case TYPE_VOID: id = idVoid; break;
case TYPE_BOOLEAN: id = idBoolean; break;
case TYPE_BYTE: id = idByte; break;
case TYPE_CHAR: id = idChar; break;
case TYPE_SHORT: id = idShort; break;
case TYPE_INT: id = idInt; break;
case TYPE_LONG: id = idLong; break;
case TYPE_FLOAT: id = idFloat; break;
case TYPE_DOUBLE: id = idDouble; break;
default: throw new CompilerError("Not a primitive type");
}
setNames(id,null,idlName);
setRepositoryID();
}
示例5: mangleClass
import sun.tools.java.Identifier; //导入依赖的package包/类
/**
* If necessary, convert a class name to its mangled form, i.e. the
* non-inner class name used in the binary representation of
* inner classes. This is necessary to be able to name inner
* classes in the generated source code in places where the language
* does not permit it, such as when synthetically defining an inner
* class outside of its outer class, and for generating file names
* corresponding to inner classes.
*
* Currently this mangling involves modifying the internal names of
* inner classes by converting occurrences of ". " into "$".
*
* This code is taken from the "mangleInnerType" method of
* the "sun.tools.java.Type" class; this method cannot be accessed
* itself because it is package protected.
*/
static final public Identifier mangleClass(Identifier className) {
if (!className.isInner())
return className;
/*
* Get '.' qualified inner class name (with outer class
* qualification and no package qualification) and replace
* each '.' with '$'.
*/
Identifier mangled = Identifier.lookup(
className.getFlatName().toString()
.replace('.', sun.tools.java.Constants.SIGC_INNERCLASS));
if (mangled.isInner())
throw new Error("failed to mangle inner class name");
// prepend package qualifier back for returned identifier
return Identifier.lookup(className.getQualifier(), mangled);
}