Example usage for org.objectweb.asm.commons Method Method

List of usage examples for org.objectweb.asm.commons Method Method

Introduction

In this page you can find the example usage for org.objectweb.asm.commons Method Method.

Prototype

public Method(final String name, final Type returnType, final Type[] argumentTypes) 

Source Link

Document

Constructs a new Method .

Usage

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the delete JSON property method.
 *
 * @return The delete JSON property method.
 *///  w w w.j  a v a 2 s.co  m
private Method getDeleteJsonPropertyMethod() {
    return new Method("deleteProperty", Type.BOOLEAN_TYPE, new Type[] { Type.getType(String.class) });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the get property method for the JSON primitive with the given
 * type./*w ww  . j av  a2 s .c  o m*/
 *
 * @param jsonPrimitiveType The type of the JSON primitive.
 * @return The get JSON primitive property method.
 */
private Method getGetJsonPrimitivePropertyMethod(Type jsonPrimitiveType) {
    return new Method("get" + getJsonPrimitiveName(jsonPrimitiveType) + "Property", jsonPrimitiveType,
            new Type[] { Type.getType(String.class) });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the set property method for the JSON primitive with the given
 * type.//  www . j  a  v a  2  s . c om
 *
 * @param jsonPrimitiveType The type of the JSON primitive.
 * @return The set JSON primitive property method.
 */
private Method getSetJsonPrimitivePropertyMethod(Type jsonPrimitiveType) {
    return new Method("set" + getJsonPrimitiveName(jsonPrimitiveType) + "Property", Type.VOID_TYPE,
            new Type[] { Type.getType(String.class), jsonPrimitiveType });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the get JSON object property method.
 *
 * @return The get JSON object property method.
 *//*w w w .java 2 s  . c  o m*/
private Method getGetJsonObjectPropertyMethod() {
    return new Method("getObjectProperty", getJsonObjectType(),
            new Type[] { Type.getType(String.class), Type.getType(Class.class) });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the set JSON object property method.
 *
 * @return The set JSON object property method.
 *//*  w  w w .  ja v  a  2 s  . co m*/
private Method getSetJsonObjectPropertyMethod() {
    return new Method("setObjectProperty", Type.VOID_TYPE,
            new Type[] { Type.getType(String.class), getJsonObjectType() });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the cast composite element method for the JSON object with the
 * given type./*from w w w  .j  av  a 2  s . co m*/
 *
 * @param jsonObjectType The type of the JSON object.
 * @return  The cast composite JSON object element method.
 */
private Method getCastCompositeJsonObjectElementMethod(Type jsonObjectType) {
    return new Method("castElement", jsonObjectType, new Type[] { Type.getType(Class.class) });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the from JSON property method for the property of the given type.
 *
 * @param jsonPropertyType The type of the JSON property.
 * @param propertyType The type of the property.
 * @return The from JSON property method.
 */// www .  j ava  2s  .c  o  m
private Method getFromJsonPropertyMethod(Type jsonPropertyType, Type propertyType) {
    return new Method("fromJsonProperty", propertyType, new Type[] { jsonPropertyType });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the to JSON property method for the property of the given type.
 *
 * @param jsonPropertyType The type of the JSON property.
 * @param propertyType The type of the property.
 * @return The to JSON property method.//from w w  w  . ja va  2 s . co m
 */
private Method getToJsonPropertyMethod(Type jsonPropertyType, Type propertyType) {
    return new Method("toJsonProperty", jsonPropertyType, new Type[] { propertyType });
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the to method for the Java primitive with the given type.
 *
 * @param javaPrimitiveType The type of the Java primitive.
 * @return The to Java primitive method.
 *//* w w w  .  ja  va 2 s .co  m*/
private Method getToJavaPrimitiveMethod(Type javaPrimitiveType) {
    return new Method(javaPrimitiveType.getClassName() + "Value", javaPrimitiveType, new Type[] {});
}

From source file:org.kjots.json.object.JsonObjectGeneratorBase.java

License:Apache License

/**
 * Retrieve the from method for the Java primitive with the given type.
 *
 * @param javaPrimitiveType The type of the Java primitive.
 * @return The from Java primitive method.
 *//*from w  w w.  java2  s. c  o m*/
private Method getFromJavaPrimitiveMethod(Type javaPrimitiveType) {
    return new Method("valueOf", this.getWrapperType(javaPrimitiveType), new Type[] { javaPrimitiveType });
}