Class getCreatedClass(OgnlContext context) throws ClassNotFoundException { return OgnlRuntime.classForName(context, className); }
Class getCreatedClass(OgnlContext context) throws ClassNotFoundException { return OgnlRuntime.classForName(context, className); }
public static boolean isInstance(OgnlContext context, Object value, String className) throws OgnlException { try { Class c = classForName(context, className); return c.isInstance(value); } catch (ClassNotFoundException e) { throw new OgnlException("No such class: " + className, e); } }
public static boolean isInstance(OgnlContext context, Object value, String className) throws OgnlException { try { Class c = classForName(context, className); return c.isInstance(value); } catch (ClassNotFoundException e) { throw new OgnlException("No such class: " + className, e); } }
public static final boolean isInstance( OgnlContext context, Object value, String className ) throws OgnlException { try { Class c = classForName( context, className); return c.isInstance( value ); } catch (ClassNotFoundException e) { throw new OgnlException( "No such class: " + className, e ); } }
Class c = OgnlRuntime.classForName(context, className);
public boolean isNodeConstant( OgnlContext context ) throws OgnlException { boolean result = false; Exception reason = null; try { Class c = OgnlRuntime.classForName(context, className); /* Check for virtual static field "class"; this cannot interfere with normal static fields because it is a reserved word. It is considered constant. */ if (fieldName.equals("class")) { result = true; } else { Field f = c.getField(fieldName); if (!Modifier.isStatic(f.getModifiers())) { throw new OgnlException( "Field " + fieldName + " of class " + className + " is not static" ); } result = Modifier.isFinal(f.getModifiers()); } } catch (ClassNotFoundException e) { reason = e; } catch (NoSuchFieldException e) { reason = e; } catch (SecurityException e) { reason = e; } if (reason != null) { throw new OgnlException( "Could not get static field " + fieldName + " from class " + className, reason ); } return result; }
public static Object callStaticMethod(OgnlContext context, String className, String methodName, Object[] args) throws OgnlException { try { Class targetClass = classForName(context, className); if (targetClass == null) throw new ClassNotFoundException("Unable to resolve class with name " + className); MethodAccessor ma = getMethodAccessor(targetClass); return ma.callStaticMethod(context, targetClass, methodName, args); } catch (ClassNotFoundException ex) { throw new MethodFailedException(className, methodName, ex); } }
try Class c = classForName(context, className);
Class c = OgnlRuntime.classForName(context, className);
public static Object callStaticMethod(OgnlContext context, String className, String methodName, Object[] args) throws OgnlException { try { Class targetClass = classForName(context, className); if (targetClass == null) throw new ClassNotFoundException("Unable to resolve class with name " + className); MethodAccessor ma = getMethodAccessor(targetClass); return ma.callStaticMethod(context, targetClass, methodName, args); } catch (ClassNotFoundException ex) { throw new MethodFailedException(className, methodName, ex); } }
Class c = OgnlRuntime.classForName(context, className);
public static final Object callStaticMethod( OgnlContext context, String className, String methodName, Object[] args ) throws OgnlException, MethodFailedException { try { Object result; Class targetClass = classForName(context, className); MethodAccessor ma = getMethodAccessor(targetClass); return ma.callStaticMethod(context, targetClass, methodName, args); } catch (ClassNotFoundException ex) { throw new MethodFailedException(className, methodName, ex); } }
Class c = OgnlRuntime.classForName(context, className);
protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException { Map answer; if (className == null) { try { answer = (Map)DEFAULT_MAP_CLASS.newInstance(); } catch (Exception ex) { /* This should never happen */ throw new OgnlException("Default Map class '" + DEFAULT_MAP_CLASS.getName() + "' instantiation error", ex); } } else { try { answer = (Map)OgnlRuntime.classForName(context, className).newInstance(); } catch (Exception ex) { throw new OgnlException("Map implementor '" + className + "' not found", ex); } } for ( int i=0; i < jjtGetNumChildren(); ++i ) { ASTKeyValue kv = (ASTKeyValue)children[i]; Node k = kv.getKey(), v = kv.getValue(); answer.put( k.getValue(context, source), (v == null) ? null : v.getValue(context, source) ); } return answer; }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Map answer; if (className == null) { try { answer = (Map) DEFAULT_MAP_CLASS.newInstance(); } catch (Exception ex) { /* This should never happen */ throw new OgnlException("Default Map class '" + DEFAULT_MAP_CLASS.getName() + "' instantiation error", ex); } } else { try { answer = (Map) OgnlRuntime.classForName(context, className).newInstance(); } catch (Exception ex) { throw new OgnlException("Map implementor '" + className + "' not found", ex); } } for(int i = 0; i < jjtGetNumChildren(); ++i) { ASTKeyValue kv = (ASTKeyValue) _children[i]; Node k = kv.getKey(), v = kv.getValue(); answer.put(k.getValue(context, source), (v == null) ? null : v.getValue(context, source)); } return answer; }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Map answer; if (className == null) { try { answer = (Map) DEFAULT_MAP_CLASS.newInstance(); } catch (Exception ex) { /* This should never happen */ throw new OgnlException("Default Map class '" + DEFAULT_MAP_CLASS.getName() + "' instantiation error", ex); } } else { try { answer = (Map) OgnlRuntime.classForName(context, className).newInstance(); } catch (Exception ex) { throw new OgnlException("Map implementor '" + className + "' not found", ex); } } for(int i = 0; i < jjtGetNumChildren(); ++i) { ASTKeyValue kv = (ASTKeyValue) _children[i]; Node k = kv.getKey(), v = kv.getValue(); answer.put(k.getValue(context, source), (v == null) ? null : v.getValue(context, source)); } return answer; }
Constructor ctor = null; Class[] ctorParameterTypes = null; Class target = classForName(context, className); List constructors = getConstructors(target);
Class target = classForName(context, className); List constructors = getConstructors(target);
if (args.length == 1) { try { Class componentClass = OgnlRuntime.classForName(context, className); List sourceList = null; int size;