/** * Appends the standard naming context for evaluating an OGNL expression * into the context given so that cached maps can be used as a context. * * @param root the root of the object graph * @param context the context to which OGNL context will be added. * @return Context Map with the keys <CODE>root</CODE> and <CODE>context</CODE> * set appropriately */ public static Map addDefaultContext( Object root, Map context ) { return addDefaultContext( root, null, null, null, context ); }
/** * Appends the standard naming context for evaluating an OGNL expression * into the context given so that cached maps can be used as a context. * * @param root the root of the object graph * @param context the context to which OGNL context will be added. * @return Context Map with the keys <CODE>root</CODE> and <CODE>context</CODE> * set appropriately */ public static Map addDefaultContext( Object root, ClassResolver classResolver, Map context ) { return addDefaultContext(root, classResolver, null, null, context); }
/** * Appends the standard naming context for evaluating an OGNL expression * into the context given so that cached maps can be used as a context. * * @param root the root of the object graph * @param context the context to which OGNL context will be added. * @return Context Map with the keys <CODE>root</CODE> and <CODE>context</CODE> * set appropriately */ public static Map addDefaultContext( Object root, ClassResolver classResolver, TypeConverter converter, Map context ) { return addDefaultContext(root, classResolver, converter, null, context); }
public static boolean isSimpleProperty(Object tree, Map context) throws OgnlException { return ((SimpleNode) tree).isSimpleProperty((OgnlContext) addDefaultContext(null, context)); }
public static boolean isSimpleNavigationChain(Object tree, Map context) throws OgnlException { return ((SimpleNode) tree).isSimpleNavigationChain((OgnlContext) addDefaultContext(null, context)); }
/** * Creates and returns a new standard naming context for evaluating an OGNL * expression. * * @param root the root of the object graph * @return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> * set appropriately */ public static Map createDefaultContext( Object root, ClassResolver classResolver, TypeConverter converter ) { return addDefaultContext( root, classResolver, converter, null, new OgnlContext() ); }
/** * Creates and returns a new standard naming context for evaluating an OGNL * expression. * * @param root the root of the object graph * @return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> * set appropriately */ public static Map createDefaultContext( Object root, ClassResolver classResolver, TypeConverter converter, MemberAccess memberAccess ) { return addDefaultContext( root, classResolver, converter, memberAccess, new OgnlContext() ); }
/** * Creates and returns a new standard naming context for evaluating an OGNL * expression. * * @param root the root of the object graph * @return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> * set appropriately */ public static Map createDefaultContext( Object root ) { return addDefaultContext( root, null, null, null, new OgnlContext() ); }
/** * Creates and returns a new standard naming context for evaluating an OGNL * expression. * * @param root the root of the object graph * @return a new OgnlContext with the keys <CODE>root</CODE> and <CODE>context</CODE> * set appropriately */ public static Map createDefaultContext( Object root, ClassResolver classResolver ) { return addDefaultContext( root, classResolver, null, null, new OgnlContext() ); }
public static boolean isSimpleProperty(Object tree, Map context) throws OgnlException { return ((SimpleNode) tree).isSimpleProperty((OgnlContext) addDefaultContext(null, context)); }
public static boolean isSimpleNavigationChain(Object tree, Map context) throws OgnlException { return ((SimpleNode) tree).isSimpleNavigationChain((OgnlContext) addDefaultContext(null, context)); }
public static boolean isSimpleProperty( Object tree, Map context ) throws OgnlException { return ((SimpleNode)tree).isSimpleProperty( (OgnlContext)addDefaultContext( null, context ) ); }
public static boolean isConstant( Object tree, Map context ) throws OgnlException { return ((SimpleNode)tree).isConstant( (OgnlContext)addDefaultContext( null, context ) ); }
public static boolean isSimpleNavigationChain( Object tree, Map context ) throws OgnlException { return ((SimpleNode)tree).isSimpleNavigationChain( (OgnlContext)addDefaultContext( null, context ) ); }
/** * Creates and returns a new standard naming context for evaluating an OGNL expression. * * @param root * the root of the object graph * @return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> set * appropriately * * @deprecated it will be removed soon */ @Deprecated public static Map createDefaultContext(Object root) { return addDefaultContext(root, null, null, null, new OgnlContext(null, null, null)); }
/** * Creates and returns a new standard naming context for evaluating an OGNL expression. * * @param root * The root of the object graph. * @param memberAccess * Java security handling object to determine semantics for accessing normally private/protected * methods / fields. * @return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> set * appropriately */ public static Map createDefaultContext(Object root, MemberAccess memberAccess) { return addDefaultContext(root, memberAccess, null, null, new OgnlContext(null, null, memberAccess)); }
/** * Creates and returns a new standard naming context for evaluating an OGNL expression. * * @param root * the root of the object graph * @return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> set * appropriately * * @deprecated it will be removed soon */ @Deprecated public static Map createDefaultContext(Object root) { return addDefaultContext(root, null, null, null, new OgnlContext(null, null, null)); }
/** * Creates and returns a new standard naming context for evaluating an OGNL expression. * * @param root * The root of the object graph. * @param memberAccess * Java security handling object to determine semantics for accessing normally private/protected * methods / fields. * @return a new Map with the keys <CODE>root</CODE> and <CODE>context</CODE> set * appropriately */ public static Map createDefaultContext(Object root, MemberAccess memberAccess) { return addDefaultContext(root, memberAccess, null, null, new OgnlContext(null, null, memberAccess)); }
/** Returns an OGNL context for the specified XEL context. */ public static Map getContext(XelContext ctx) { final FunctionMapper mapper = ctx.getFunctionMapper(); return Ognl.addDefaultContext(null, mapper != null ? new MapperClassResolver(mapper): null, Collections.EMPTY_MAP); //Note: we always pass null as the context, since //we use ResolverAccessor as the root } /** Returns the root object.
static Map addClassResolverIfNecessary(Map ctx, Object root) { if (root instanceof S2Container) { S2Container container = (S2Container) root; ClassLoader classLoader = container.getClassLoader(); if (classLoader != null) { ClassResolverImpl classResolver = new ClassResolverImpl( classLoader); if (ctx == null) { ctx = Ognl.createDefaultContext(root, classResolver); } else { ctx = Ognl.addDefaultContext(root, classResolver, ctx); } } } return ctx; }