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


Java Type.BOOLEAN属性代码示例

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


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

示例1: generateEqualsMethod

private void generateEqualsMethod(String generatedClassName) {

        /* public boolean equals(Object o) {
         *   return stubHelper.isEquals(this,o);
         * }
         */

        InstructionList il = new InstructionList();
        MethodGen method = new MethodGen(Constants.ACC_PUBLIC, Type.BOOLEAN, new Type[]{Type.OBJECT}, new String[]{"arg0"}, "equals", generatedClassName, il, constantsPool);

        il.append(InstructionFactory.createLoad(Type.OBJECT, 0));

        il.append(factory.createFieldAccess(generatedClassName, "stubHelper", new ObjectType("org.codehaus.jremoting.client.StubHelper"), Constants.GETFIELD));
        il.append(InstructionFactory.createLoad(Type.OBJECT, 0));
        il.append(InstructionFactory.createLoad(Type.OBJECT, 1));

        il.append(factory.createInvoke("org.codehaus.jremoting.client.StubHelper", "isEquals", Type.BOOLEAN, new Type[]{Type.OBJECT, Type.OBJECT}, Constants.INVOKEINTERFACE));
        il.append(InstructionFactory.createReturn(Type.INT));
        method.setMaxStack();
        method.setMaxLocals();
        classGen.addMethod(method.getMethod());
        il.dispose();
    }
 
开发者ID:paul-hammant,项目名称:JRemoting,代码行数:23,代码来源:BcelStubGenerator.java

示例2: getNativeValue

/**
 * Returns a string representation of a given object native value.
 * 
 * @param type - a Class object that wraps a data type.
 * @param value - an object that wraps a value of a primitive data type.
 * @return a string that represents a native data type.
 */
public static String getNativeValue(Type type, ConstantValue value) {
    StringBuffer result = new StringBuffer();

    if (type == Type.INT) {
        result.append(value.toString()).append('L');
    } else if (type == Type.BYTE) {
        result.append(value.toString()).append('L');
    } else if (type == Type.LONG) {
        result.append(value.toString()).append("LL");
    } else if (type == Type.FLOAT) {
        result.append(value.toString()).append('f');
    } else if (type == Type.DOUBLE) {
        result.append(value.toString());
    } else if (type == Type.SHORT) {
        result.append(value.toString()).append('L');
    } else if (type == Type.CHAR) {
        result.append(value.toString()).append('L');
    } else if (type == Type.BOOLEAN) {
        result.append(value.toString()).append('L');
    }

    return result.toString();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:ClazzField.java

示例3: getTypeForPrimitive

protected Type getTypeForPrimitive(Class<?> type) {
    if (type == boolean.class) {
        return Type.BOOLEAN;
    } else if (type == byte.class) {
        return Type.BYTE;
    } else if (type == char.class) {
        return Type.CHAR;
    } else if (type == short.class) {
        return Type.SHORT;
    } else if (type == int.class) {
        return Type.INT;
    } else if (type == long.class) {
        return Type.LONG;
    } else if (type == float.class) {
        return Type.FLOAT;
    } else if (type == double.class) {
        return Type.DOUBLE;
    } else if (type == void.class) {
        return Type.VOID;
    }
    return null;
}
 
开发者ID:abassouk,项目名称:autodao,代码行数:22,代码来源:BaseClassGenAnalysis.java

示例4: set

/**
 * Sets a new Type for the given local variable slot.
 */
public void set(int i, Type type){
	if (type == Type.BYTE || type == Type.SHORT || type == Type.BOOLEAN || type == Type.CHAR){
		throw new AssertionViolatedException("LocalVariables do not know about '"+type+"'. Use Type.INT instead.");
	}
	locals[i] = type;
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:9,代码来源:LocalVariables.java

示例5: getBCELPrimitiveType

/**
 * Method getBCELPrimitiveType.
 * Returns the BCEL Type given the Class Name
 *
 * @param javaDataType the java data type
 * @return Type the BCEL type
 */
protected Type getBCELPrimitiveType(String javaDataType) {
    switch (javaDataType.charAt(0)) {

        case 'b':
            if (javaDataType.charAt(1) == 'o') {
                return Type.BOOLEAN;
            } else {
                return Type.BYTE;
            }
        case 'c':
        case 'C':
            return Type.CHAR;
        case 's':
        case 'S':
            return Type.SHORT;
        case 'i':
        case 'I':
            return Type.INT;
        case 'l':
        case 'L':
            return Type.LONG;
        case 'f':
        case 'F':
            return Type.FLOAT;
        case 'd':
        case 'D':
            return Type.DOUBLE;
            //boolean array appears in this format
        case 'Z':
            return Type.BOOLEAN;
        case 'B':
            return Type.BYTE;
        case 'v':
        case 'V':
            return Type.VOID;
    }
    return null;
}
 
开发者ID:paul-hammant,项目名称:JRemoting,代码行数:45,代码来源:BcelStubGenerator.java

示例6: BooleanClass

BooleanClass()
{
   super("Boolean", Type.BOOLEAN, Boolean.TYPE, "readBoolean");
}
 
开发者ID:diana-hep,项目名称:root4j,代码行数:4,代码来源:IntrinsicRootClass.java

示例7: getJNIType

/**
 * Returns a JNI-style representation of the given data type passed
 * as a Class object.
 * 
 * @param type - a Class object that wraps a data type.
 * @return a string that represents a JNI-style data type.
 */
public static String getJNIType(Type type) {
    StringBuffer result = new StringBuffer();

    String suffix = "";
    if (type instanceof ArrayType) {
        suffix = "Array";
        type = ((ArrayType) type).getElementType();
    }

    if (type instanceof ObjectType) {
        String objectType = "jobject";
        // The suffix length is 0 only if the given type is not an array.
        if (suffix.length() == 0) {
            if (type.equals(Type.STRING)) {
                objectType = "jstring";
            } else if (type.equals(Type.THROWABLE)) {
                objectType = "jthrowable";
            } else if (((ObjectType) type).getClassName()
                    .equals("java.lang.Class")) {
                objectType = "jclass";
            }
        }
        result.append(objectType);
    } else if (type == Type.INT) {
        result.append("jint");
    } else if (type == Type.BYTE) {
        result.append("jbyte");
    } else if (type == Type.LONG) {
        result.append("jlong");
    } else if (type == Type.FLOAT) {
        result.append("jfloat");
    } else if (type == Type.DOUBLE) {
        result.append("jdouble");
    } else if (type == Type.SHORT) {
        result.append("jshort");
    } else if (type == Type.CHAR) {
        result.append("jchar");
    } else if (type == Type.BOOLEAN) {
        result.append("jboolean");
    } else if (type == Type.VOID) {
        result.append("void");
    }

    return result.append(suffix).toString();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:52,代码来源:ClazzMethod.java

示例8: getType

@Override
public Type getType( ConstantPoolGen cp ) {
    return Type.BOOLEAN;
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:4,代码来源:NullnessConversationInstruction.java


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