当前位置: 首页>>代码示例>>Java>>正文


Java EmptyArray.TYPE_VARIABLE属性代码示例

本文整理汇总了Java中libcore.util.EmptyArray.TYPE_VARIABLE属性的典型用法代码示例。如果您正苦于以下问题:Java EmptyArray.TYPE_VARIABLE属性的具体用法?Java EmptyArray.TYPE_VARIABLE怎么用?Java EmptyArray.TYPE_VARIABLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在libcore.util.EmptyArray的用法示例。


在下文中一共展示了EmptyArray.TYPE_VARIABLE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseForClass

/**
 * Parses the generic signature of a class and creates the data structure
 * representing the signature.
 *
 * @param genericDecl the GenericDeclaration calling this method
 * @param signature the generic signature of the class
 */
public void parseForClass(GenericDeclaration genericDecl, String signature) {
    setInput(genericDecl, signature);
    if (!eof) {
        parseClassSignature();
    } else {
        if(genericDecl instanceof Class) {
            Class c = (Class) genericDecl;
            this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
            this.superclassType = c.getSuperclass();
            Class<?>[] interfaces = c.getInterfaces();
            if (interfaces.length == 0) {
                this.interfaceTypes = ListOfTypes.EMPTY;
            } else {
                this.interfaceTypes = new ListOfTypes(interfaces);
            }
        } else {
            this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
            this.superclassType = Object.class;
            this.interfaceTypes = ListOfTypes.EMPTY;
        }
    }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:29,代码来源:GenericSignatureParser.java

示例2: parseForMethod

/**
 * Parses the generic signature of a method and creates the data structure
 * representing the signature.
 *
 * @param genericDecl the GenericDeclaration calling this method
 * @param signature the generic signature of the class
 */
public void parseForMethod(GenericDeclaration genericDecl,
        String signature, Class<?>[] rawExceptionTypes) {
    setInput(genericDecl, signature);
    if (!eof) {
        parseMethodTypeSignature(rawExceptionTypes);
    } else {
        Method m = (Method) genericDecl;
        this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
        Class<?>[] parameterTypes = m.getParameterTypes();
        if (parameterTypes.length == 0) {
            this.parameterTypes = ListOfTypes.EMPTY;
        } else {
            this.parameterTypes = new ListOfTypes(parameterTypes);
        }
        Class<?>[] exceptionTypes = m.getExceptionTypes();
        if (exceptionTypes.length == 0) {
            this.exceptionTypes = ListOfTypes.EMPTY;
        } else {
            this.exceptionTypes = new ListOfTypes(exceptionTypes);
        }
        this.returnType = m.getReturnType();
    }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:30,代码来源:GenericSignatureParser.java

示例3: parseForConstructor

/**
 * Parses the generic signature of a constructor and creates the data
 * structure representing the signature.
 *
 * @param genericDecl the GenericDeclaration calling this method
 * @param signature the generic signature of the class
 */
public void parseForConstructor(GenericDeclaration genericDecl,
        String signature, Class<?>[] rawExceptionTypes) {
    setInput(genericDecl, signature);
    if (!eof) {
        parseMethodTypeSignature(rawExceptionTypes);
    } else {
        Constructor c = (Constructor) genericDecl;
        this.formalTypeParameters = EmptyArray.TYPE_VARIABLE;
        Class<?>[] parameterTypes = c.getParameterTypes();
        if (parameterTypes.length == 0) {
            this.parameterTypes = ListOfTypes.EMPTY;
        } else {
            this.parameterTypes = new ListOfTypes(parameterTypes);
        }
        Class<?>[] exceptionTypes = c.getExceptionTypes();
        if (exceptionTypes.length == 0) {
            this.exceptionTypes = ListOfTypes.EMPTY;
        } else {
            this.exceptionTypes = new ListOfTypes(exceptionTypes);
        }
    }
}
 
开发者ID:Sellegit,项目名称:j2objc,代码行数:29,代码来源:GenericSignatureParser.java


注:本文中的libcore.util.EmptyArray.TYPE_VARIABLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。