本文整理汇总了Java中sun.tools.java.ClassDefinition.isInterface方法的典型用法代码示例。如果您正苦于以下问题:Java ClassDefinition.isInterface方法的具体用法?Java ClassDefinition.isInterface怎么用?Java ClassDefinition.isInterface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.tools.java.ClassDefinition
的用法示例。
在下文中一共展示了ClassDefinition.isInterface方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: couldBeRemote
import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
private static boolean couldBeRemote (boolean quiet, ContextStack stack,
ClassDefinition classDef) {
boolean result = false;
BatchEnvironment env = stack.getEnv();
try {
if (!classDef.isInterface()) {
failedConstraint(16,quiet,stack,classDef.getName());
} else {
result = env.defRemote.implementedBy(env,classDef.getClassDeclaration());
if (!result) failedConstraint(1,quiet,stack,classDef.getName());
}
} catch (ClassNotFound e) {
classNotFound(stack,e);
}
return result;
}
示例2: couldBeAbstract
import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
private static boolean couldBeAbstract(ContextStack stack, ClassDefinition classDef,
boolean quiet) {
// Return true if interface and not remote...
boolean result = false;
if (classDef.isInterface()) {
BatchEnvironment env = stack.getEnv();
try {
result = ! env.defRemote.implementedBy(env, classDef.getClassDeclaration());
if (!result) failedConstraint(15,quiet,stack,classDef.getName());
} catch (ClassNotFound e) {
classNotFound(stack,e);
}
} else {
failedConstraint(14,quiet,stack,classDef.getName());
}
return result;
}
示例3: ClassType
import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
/**
* Create a ClassType instance for the given class. NOTE: This constructor
* is ONLY for SpecialClassType.
*/
protected ClassType(ContextStack stack, int typeCode, ClassDefinition classDef) {
super(stack,typeCode,classDef); // Call special parent constructor.
if ((typeCode & TM_CLASS) == 0 && classDef.isInterface()) {
throw new CompilerError("Not a class");
}
parent = null;
}
示例4: InterfaceType
import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
/**
* Create a InterfaceType instance for the given class. NOTE: This constructor
* is ONLY for SpecialInterfaceType.
*/
protected InterfaceType(ContextStack stack, int typeCode, ClassDefinition classDef) {
super(stack,typeCode,classDef); // Call special parent constructor.
if ((typeCode & TM_INTERFACE) == 0 || ! classDef.isInterface()) {
throw new CompilerError("Not an interface");
}
}
示例5: getTopType
import sun.tools.java.ClassDefinition; //导入方法依赖的package包/类
/**
* Create and return a top-level type.
* @param cdef The top-level class definition.
* @param stack The context stack.
* @return The compound type or null if is non-conforming.
*/
protected CompoundType getTopType(ClassDefinition cdef, ContextStack stack) {
CompoundType result = null;
// Do we have an interface?
if (cdef.isInterface()) {
// Yes, so first try Abstract...
result = AbstractType.forAbstract(cdef,stack,true);
if (result == null) {
// Then try Remote...
result = RemoteType.forRemote(cdef,stack,false);
}
} else {
// Not an interface, so try Implementation...
result = ImplementationType.forImplementation(cdef,stack,false);
}
return result;
}