当前位置: 首页>>代码示例>>Java>>正文


Java ParserContext.addVariable方法代码示例

本文整理汇总了Java中org.mvel2.ParserContext.addVariable方法的典型用法代码示例。如果您正苦于以下问题:Java ParserContext.addVariable方法的具体用法?Java ParserContext.addVariable怎么用?Java ParserContext.addVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mvel2.ParserContext的用法示例。


在下文中一共展示了ParserContext.addVariable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ProtoVarNode

import org.mvel2.ParserContext; //导入方法依赖的package包/类
public ProtoVarNode(char[] expr, int fields, Proto type, ParserContext pCtx) {
    this.egressType = Proto.ProtoInstance.class;
    this.fields = fields;

    int assignStart;
    if ((assignStart = find(super.name = expr, '=')) != -1) {
        checkNameSafety(name = createStringTrimmed(expr, 0, assignStart));

        if (((fields |= ASSIGN) & COMPILE_IMMEDIATE) != 0) {
            statement = (ExecutableStatement) subCompileExpression(stmt = subset(expr, assignStart + 1), pCtx);
        }
        else {
            stmt = subset(expr, assignStart + 1);
        }
    }
    else {
        checkNameSafety(name = new String(expr));
    }

    if ((fields & COMPILE_IMMEDIATE) != 0) {
        pCtx.addVariable(name, egressType, true);
    }
}
 
开发者ID:codehaus,项目名称:mvel,代码行数:24,代码来源:ProtoVarNode.java

示例2: TypedVarNode

import org.mvel2.ParserContext; //导入方法依赖的package包/类
public TypedVarNode(char[] expr, int fields, Class type, ParserContext pCtx) {
    this.egressType = type;
    this.fields = fields;

    int assignStart;
    if ((assignStart = find(super.name = expr, '=')) != -1) {
        checkNameSafety(name = createStringTrimmed(expr, 0, assignStart));

        if (((fields |= ASSIGN) & COMPILE_IMMEDIATE) != 0) {
            statement = (ExecutableStatement) subCompileExpression(stmt = subset(expr, assignStart + 1), pCtx);
        }
        else {
            stmt = subset(expr, assignStart + 1);
        }
    }
    else {
        checkNameSafety(name = new String(expr));
    }

    if ((fields & COMPILE_IMMEDIATE) != 0) {
        pCtx.addVariable(name, egressType, true);
    }
}
 
开发者ID:codehaus,项目名称:mvel,代码行数:24,代码来源:TypedVarNode.java

示例3: AssignmentNode

import org.mvel2.ParserContext; //导入方法依赖的package包/类
public AssignmentNode(char[] expr, int fields, ParserContext pCtx) {
    this.name = expr;
    int assignStart;

    if ((assignStart = find(expr, '=')) != -1) {
        this.varName = createStringTrimmed(expr, 0, assignStart);
        stmt = subset(expr, assignStart + 1);

        if ((fields & COMPILE_IMMEDIATE) != 0) {
            this.egressType = (statement = (ExecutableStatement) subCompileExpression(stmt, pCtx)).getKnownEgressType();
        }

        if (col = ((endOfName = findFirst('[', indexTarget = this.varName.toCharArray())) > 0)) {
            if (((this.fields |= COLLECTION) & COMPILE_IMMEDIATE) != 0) {
                accExpr = (CompiledAccExpression) compileSetExpression(indexTarget, pCtx);
            }

            this.varName = new String(expr, 0, endOfName);
            index = new String(indexTarget, endOfName, indexTarget.length - endOfName);
        }

        checkNameSafety(this.varName);
    }
    else {
        checkNameSafety(this.varName = new String(expr));
    }

    if ((fields & COMPILE_IMMEDIATE) != 0) {
        pCtx.addVariable(this.varName, egressType);
    }

    this.name = this.varName.toCharArray();
}
 
开发者ID:codehaus,项目名称:mvel,代码行数:34,代码来源:AssignmentNode.java

示例4: DeclTypedVarNode

import org.mvel2.ParserContext; //导入方法依赖的package包/类
public DeclTypedVarNode(String name, Class type, int fields, ParserContext pCtx) {
    this.egressType = type;
    checkNameSafety(this.name = name);

    if ((fields & COMPILE_IMMEDIATE) != 0) {
        pCtx.addVariable(name, egressType, true);
    }
}
 
开发者ID:codehaus,项目名称:mvel,代码行数:9,代码来源:DeclTypedVarNode.java

示例5: DeclProtoVarNode

import org.mvel2.ParserContext; //导入方法依赖的package包/类
public DeclProtoVarNode(String name, Proto type, int fields, ParserContext pCtx) {
    this.egressType = Proto.ProtoInstance.class;
    checkNameSafety(this.name = name);

    if ((fields & COMPILE_IMMEDIATE) != 0) {
        pCtx.addVariable(name, egressType, true);
    }
}
 
开发者ID:codehaus,项目名称:mvel,代码行数:9,代码来源:DeclProtoVarNode.java

示例6: IndexedAssignmentNode

import org.mvel2.ParserContext; //导入方法依赖的package包/类
public IndexedAssignmentNode(char[] expr, int fields, int operation, String name, int register, ParserContext pCtx) {
    super.name = expr;
    this.register = register;

    int assignStart;

    if (operation != -1) {
        checkNameSafety(this.name = name);

        this.egressType = (statement = (ExecutableStatement)
                subCompileExpression(stmt = createShortFormOperativeAssignment(name, expr, operation), pCtx)).getKnownEgressType();
    }
    else if ((assignStart = find(expr, '=')) != -1) {
        this.name = createStringTrimmed(expr, 0, assignStart);
        this.egressType = (statement
                = (ExecutableStatement) subCompileExpression(stmt = subset(expr, assignStart + 1), pCtx))
                .getKnownEgressType();

        if (col = ((endOfName = (short) findFirst('[', indexTarget = this.name.toCharArray())) > 0)) {
            if (((this.fields |= COLLECTION) & COMPILE_IMMEDIATE) != 0) {
                accExpr = (CompiledAccExpression) compileSetExpression(indexTarget, pCtx);
            }

            this.name = new String(expr, 0, endOfName);
            index = subset(indexTarget, endOfName, indexTarget.length - endOfName);
        }

        checkNameSafety(this.name);
    }
    else {
        checkNameSafety(this.name = new String(expr));
    }

    if ((fields & COMPILE_IMMEDIATE) != 0) {
        pCtx.addVariable(name, egressType);
    }
}
 
开发者ID:codehaus,项目名称:mvel,代码行数:38,代码来源:IndexedAssignmentNode.java


注:本文中的org.mvel2.ParserContext.addVariable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。