Java Code Examples for org.apache.el.util.ReflectionUtil

The following examples show how to use org.apache.el.util.ReflectionUtil. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Tomcat8-Source-Read   Source File: FunctionMapperImpl.java    License: MIT License 6 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF((this.prefix != null) ? this.prefix : "");
    out.writeUTF(this.localName);
    // make sure m isn't null
    getMethod();
    out.writeUTF((this.owner != null) ?
             this.owner :
             this.m.getDeclaringClass().getName());
    out.writeUTF((this.name != null) ?
             this.name :
             this.m.getName());
    out.writeObject((this.types != null) ?
             this.types :
             ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));

}
 
Example 2
Source Project: Tomcat7.0.67   Source File: FunctionMapperImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF((this.prefix != null) ? this.prefix : "");
    out.writeUTF(this.localName);
    // make sure m isn't null
    getMethod();
    out.writeUTF((this.owner != null) ?
             this.owner :
             this.m.getDeclaringClass().getName());
    out.writeUTF((this.name != null) ?
             this.name :
             this.m.getName());
    out.writeObject((this.types != null) ?
             this.types :
             ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));

}
 
Example 3
Source Project: tomcatsrc   Source File: FunctionMapperImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF((this.prefix != null) ? this.prefix : "");
    out.writeUTF(this.localName);
    // make sure m isn't null
    getMethod();
    out.writeUTF((this.owner != null) ?
             this.owner :
             this.m.getDeclaringClass().getName());
    out.writeUTF((this.name != null) ?
             this.name :
             this.m.getName());
    out.writeObject((this.types != null) ?
             this.types :
             ReflectionUtil.toTypeNameArray(this.m.getParameterTypes()));

}
 
Example 4
Source Project: Tomcat8-Source-Read   Source File: ValueExpressionLiteral.java    License: MIT License 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.value = in.readObject();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
}
 
Example 5
Source Project: Tomcat8-Source-Read   Source File: AstValue.java    License: MIT License 5 votes vote down vote up
@Override
// Interface el.parser.Node uses raw types (and is auto-generated)
public MethodInfo getMethodInfo(EvaluationContext ctx,
        @SuppressWarnings("rawtypes") Class[] paramTypes)
        throws ELException {
    Target t = getTarget(ctx);
    Method m = ReflectionUtil.getMethod(
            ctx, t.base, t.property, paramTypes, null);
    return new MethodInfo(m.getName(), m.getReturnType(), m
            .getParameterTypes());
}
 
Example 6
Source Project: Tomcat8-Source-Read   Source File: MethodExpressionImpl.java    License: MIT License 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
            .readObject()));
    this.fnMapper = (FunctionMapper) in.readObject();
    this.varMapper = (VariableMapper) in.readObject();
}
 
Example 7
Source Project: Tomcat8-Source-Read   Source File: MethodExpressionImpl.java    License: MIT License 5 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
    out.writeObject(this.fnMapper);
    out.writeObject(this.varMapper);
}
 
Example 8
Source Project: Tomcat8-Source-Read   Source File: FunctionMapperImpl.java    License: MIT License 5 votes vote down vote up
public Method getMethod() {
    if (this.m == null) {
        try {
            Class<?> t = ReflectionUtil.forName(this.owner);
            Class<?>[] p = ReflectionUtil.toTypeArray(this.types);
            this.m = t.getMethod(this.name, p);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return this.m;
}
 
Example 9
Source Project: Tomcat8-Source-Read   Source File: ValueExpressionImpl.java    License: MIT License 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.fnMapper = (FunctionMapper) in.readObject();
    this.varMapper = (VariableMapper) in.readObject();
}
 
Example 10
Source Project: Tomcat8-Source-Read   Source File: MethodExpressionLiteral.java    License: MIT License 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
            .readObject()));
}
 
Example 11
Source Project: Tomcat8-Source-Read   Source File: MethodExpressionLiteral.java    License: MIT License 5 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
}
 
Example 12
Source Project: Tomcat7.0.67   Source File: ValueExpressionLiteral.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.value = in.readObject();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
}
 
Example 13
Source Project: Tomcat7.0.67   Source File: AstValue.java    License: Apache License 2.0 5 votes vote down vote up
@Override
// Interface el.parser.Node uses raw types (and is auto-generated)
public MethodInfo getMethodInfo(EvaluationContext ctx, 
        @SuppressWarnings("rawtypes") Class[] paramTypes)
        throws ELException {
    Target t = getTarget(ctx);
    Method m = ReflectionUtil.getMethod(
            t.base, t.property, paramTypes, null);
    return new MethodInfo(m.getName(), m.getReturnType(), m
            .getParameterTypes());
}
 
Example 14
Source Project: Tomcat7.0.67   Source File: MethodExpressionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
            .readObject()));
    this.fnMapper = (FunctionMapper) in.readObject();
    this.varMapper = (VariableMapper) in.readObject();
}
 
Example 15
Source Project: Tomcat7.0.67   Source File: MethodExpressionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
    out.writeObject(this.fnMapper);
    out.writeObject(this.varMapper);
}
 
Example 16
Source Project: Tomcat7.0.67   Source File: FunctionMapperImpl.java    License: Apache License 2.0 5 votes vote down vote up
public Method getMethod() {
    if (this.m == null) {
        try {
            Class<?> t = ReflectionUtil.forName(this.owner);
            Class<?>[] p = ReflectionUtil.toTypeArray(this.types);
            this.m = t.getMethod(this.name, p);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return this.m;
}
 
Example 17
Source Project: Tomcat7.0.67   Source File: ValueExpressionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.fnMapper = (FunctionMapper) in.readObject();
    this.varMapper = (VariableMapper) in.readObject();
}
 
Example 18
Source Project: Tomcat7.0.67   Source File: MethodExpressionLiteral.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
            .readObject()));
}
 
Example 19
Source Project: Tomcat7.0.67   Source File: MethodExpressionLiteral.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
}
 
Example 20
Source Project: tomcatsrc   Source File: ValueExpressionLiteral.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.value = in.readObject();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
}
 
Example 21
Source Project: tomcatsrc   Source File: AstValue.java    License: Apache License 2.0 5 votes vote down vote up
@Override
// Interface el.parser.Node uses raw types (and is auto-generated)
public MethodInfo getMethodInfo(EvaluationContext ctx, 
        @SuppressWarnings("rawtypes") Class[] paramTypes)
        throws ELException {
    Target t = getTarget(ctx);
    Method m = ReflectionUtil.getMethod(
            t.base, t.property, paramTypes, null);
    return new MethodInfo(m.getName(), m.getReturnType(), m
            .getParameterTypes());
}
 
Example 22
Source Project: tomcatsrc   Source File: MethodExpressionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
            .readObject()));
    this.fnMapper = (FunctionMapper) in.readObject();
    this.varMapper = (VariableMapper) in.readObject();
}
 
Example 23
Source Project: tomcatsrc   Source File: MethodExpressionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
    out.writeObject(this.fnMapper);
    out.writeObject(this.varMapper);
}
 
Example 24
Source Project: tomcatsrc   Source File: FunctionMapperImpl.java    License: Apache License 2.0 5 votes vote down vote up
public Method getMethod() {
    if (this.m == null) {
        try {
            Class<?> t = ReflectionUtil.forName(this.owner);
            Class<?>[] p = ReflectionUtil.toTypeArray(this.types);
            this.m = t.getMethod(this.name, p);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return this.m;
}
 
Example 25
Source Project: tomcatsrc   Source File: ValueExpressionImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException,
        ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.fnMapper = (FunctionMapper) in.readObject();
    this.varMapper = (VariableMapper) in.readObject();
}
 
Example 26
Source Project: tomcatsrc   Source File: MethodExpressionLiteral.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.expr = in.readUTF();
    String type = in.readUTF();
    if (!"".equals(type)) {
        this.expectedType = ReflectionUtil.forName(type);
    }
    this.paramTypes = ReflectionUtil.toTypeArray(((String[]) in
            .readObject()));
}
 
Example 27
Source Project: tomcatsrc   Source File: MethodExpressionLiteral.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeUTF(this.expr);
    out.writeUTF((this.expectedType != null) ? this.expectedType.getName()
            : "");
    out.writeObject(ReflectionUtil.toTypeNameArray(this.paramTypes));
}