org.apache.el.util.ReflectionUtil Java Examples

The following examples show how to use org.apache.el.util.ReflectionUtil. 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 File: FunctionMapperImpl.java    From Tomcat8-Source-Read with 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 File: FunctionMapperImpl.java    From tomcatsrc with 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 File: FunctionMapperImpl.java    From Tomcat7.0.67 with 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 File: MethodExpressionLiteral.java    From tomcatsrc with 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 #5
Source File: ValueExpressionLiteral.java    From Tomcat8-Source-Read with 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 #6
Source File: MethodExpressionLiteral.java    From tomcatsrc with 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 #7
Source File: ValueExpressionImpl.java    From tomcatsrc with 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 #8
Source File: FunctionMapperImpl.java    From tomcatsrc with 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 #9
Source File: MethodExpressionImpl.java    From tomcatsrc with 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 #10
Source File: MethodExpressionImpl.java    From tomcatsrc with 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 #11
Source File: AstValue.java    From tomcatsrc with 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 #12
Source File: ValueExpressionLiteral.java    From tomcatsrc with 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 File: MethodExpressionLiteral.java    From Tomcat7.0.67 with 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 #14
Source File: MethodExpressionLiteral.java    From Tomcat7.0.67 with 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 #15
Source File: ValueExpressionImpl.java    From Tomcat7.0.67 with 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 #16
Source File: FunctionMapperImpl.java    From Tomcat7.0.67 with 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 File: MethodExpressionImpl.java    From Tomcat7.0.67 with 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 #18
Source File: MethodExpressionImpl.java    From Tomcat7.0.67 with 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 #19
Source File: AstValue.java    From Tomcat7.0.67 with 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 #20
Source File: ValueExpressionLiteral.java    From Tomcat7.0.67 with 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 File: MethodExpressionLiteral.java    From Tomcat8-Source-Read with 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 #22
Source File: MethodExpressionLiteral.java    From Tomcat8-Source-Read with 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 #23
Source File: ValueExpressionImpl.java    From Tomcat8-Source-Read with 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 #24
Source File: FunctionMapperImpl.java    From Tomcat8-Source-Read with 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 #25
Source File: MethodExpressionImpl.java    From Tomcat8-Source-Read with 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 #26
Source File: MethodExpressionImpl.java    From Tomcat8-Source-Read with 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 #27
Source File: AstValue.java    From Tomcat8-Source-Read with 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());
}