Package org.mvel2.integration

Examples of org.mvel2.integration.VariableResolver


        this.localVariables.put(identifier,
                value);
    }
    public VariableResolver createVariable(String name, Object value) {
        VariableResolver vr;
        try {
            vr = getVariableResolver(name);
        }
        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name), value);
        }
    }
View Full Code Here


    public VariableResolver createVariable(String name,
                                           Object value,
                                           Class type) {
        VariableResolver vr;
        try {
            vr = getVariableResolver(name);
        }
        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name, type), value);
        }
View Full Code Here

        if ( "active".equals( name ) ) {
            return item.isActive();
        }
       
        // FIXME hack as MVEL seems to be ignoring indexed variables
        VariableResolver vr = variableFactory.getNextFactory().getVariableResolver( name );
        if ( vr != null ) {
            return vr.getValue();
        }
               
        Declaration declr = item.getTerminalNode().getSubRule().getOuterDeclarations().get( name );
        if ( declr != null ) {
            return declr.getValue( null, item.getTuple().get( declr ).getObject() );
View Full Code Here

        this.localVariables.put(identifier,
                value);
    }
    public VariableResolver createVariable(String name, Object value) {
        VariableResolver vr;
        try {
            vr = getVariableResolver(name);
        }
        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name), value);
        }
    }
View Full Code Here

    public VariableResolver createVariable(String name,
                                           Object value,
                                           Class type) {
        VariableResolver vr;
        try {
            vr = getVariableResolver(name);
        }
        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name, type), value);
        }
View Full Code Here

            return indexedVariableResolvers[index];
        }

        public VariableResolver createVariable( String name,
                                                Object value ) {
            VariableResolver vr = getResolver( name );
            if ( vr != null ) {
                vr.setValue( value );
                return vr;
            } else {
                if ( nextFactory == null ) nextFactory = new MapVariableResolverFactory( new HashMap() );
                return nextFactory.createVariable( name,
                                                   value );
View Full Code Here

        }

        public VariableResolver createVariable( String name,
                                                Object value,
                                                Class< ? > type ) {
            VariableResolver vr = getResolver( name );
            if ( vr != null ) {
                if ( vr.getType() != null ) {
                    throw new RuntimeException( "variable already defined within scope: " + vr.getType() + " " + name );
                } else {
                    vr.setValue( value );
                    return vr;
                }
            } else {
                if ( nextFactory == null ) nextFactory = new MapVariableResolverFactory( new HashMap() );
                return nextFactory.createVariable( name,
View Full Code Here

                                                   type );
            }
        }

        public VariableResolver getVariableResolver( String name ) {
            VariableResolver vr = getResolver( name );
            if ( vr != null ) return vr;
            else if ( nextFactory != null ) {
                return nextFactory.getVariableResolver( name );
            }
View Full Code Here

        this.localVariables.put(identifier,
                value);
    }
    public VariableResolver createVariable(String name, Object value) {
        VariableResolver vr;
        try {
            vr = getVariableResolver(name);
        }
        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name), value);
        }
    }
View Full Code Here

    public VariableResolver createVariable(String name,
                                           Object value,
                                           Class type) {
        VariableResolver vr;
        try {
            vr = getVariableResolver(name);
        }
        catch (UnresolveablePropertyException e) {
            vr = null;
        }
        if (vr != null && vr.getType() != null) {
            throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name);
        }
        else {
            return addResolver(name, new LocalVariableResolver(this, name, type), value);
        }
View Full Code Here

TOP

Related Classes of org.mvel2.integration.VariableResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.