本文整理了Java中bsh.Interpreter.getStrictJava()
方法的一些代码示例,展示了Interpreter.getStrictJava()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Interpreter.getStrictJava()
方法的具体详情如下:
包路径:bsh.Interpreter
类名称:Interpreter
方法名:getStrictJava
暂无
代码示例来源:origin: beanshell/beanshell
public boolean getStrictJava() {
return null != declaringInterpreter && declaringInterpreter.getStrictJava();
}
代码示例来源:origin: beanshell/beanshell
/**
Evaluate to a value object.
*/
public LHS toLHS( CallStack callstack, Interpreter interpreter)
throws EvalError
{
// loosely typed map expression new {a=1, b=2} are treated
// as non assignment (LHS) to retrieve Map.Entry key values
// then wrapped in a MAP_ENTRY type LHS for value assignment.
return (LHS) eval( interpreter.getStrictJava() || !isMapExpression,
callstack, interpreter );
}
代码示例来源:origin: beanshell/beanshell
Object arr = Array.newInstance(
type, dimensionsNode.definedDimensions);
if ( !interpreter.getStrictJava() )
arrayFillDefaultValue(arr);
return arr;
代码示例来源:origin: beanshell/beanshell
this.parent = parent;
if ( parent != null )
setStrictJava( parent.getStrictJava() );
代码示例来源:origin: jitlogic/zorka
@Override
public Object visit(BSHUnaryExpression node) {
SimpleNode simpleNode = (SimpleNode)node.jjtGetChild(0);
// If this is a unary increment of decrement (either pre or postfix)
// then we need an LHS to which to assign the result. Otherwise
// just do the unary operation for the value.
try {
if ( node.kind == ParserConstants.INCR || node.kind == ParserConstants.DECR ) {
LHS lhs = primaryExprToLHS((BSHPrimaryExpression) simpleNode);
return node.lhsUnaryOperation(lhs, interpreter.getStrictJava());
} else
return
node.unaryOperation(simpleNode.accept(this), node.kind);
} catch ( UtilEvalError e ) {
throw e.toEvalError( node, callstack );
}
}
代码示例来源:origin: beanshell/beanshell
public Object eval( CallStack callstack, Interpreter interpreter)
throws EvalError
{
SimpleNode node = (SimpleNode)jjtGetChild(0);
// If this is a unary increment of decrement (either pre or postfix)
// then we need an LHS to which to assign the result. Otherwise
// just do the unary operation for the value.
try {
if ( kind == INCR || kind == DECR ) {
LHS lhs = ((BSHPrimaryExpression)node).toLHS(
callstack, interpreter );
return lhsUnaryOperation( lhs, interpreter.getStrictJava() );
} else
return
unaryOperation( node.eval(callstack, interpreter), kind );
} catch ( UtilEvalError e ) {
throw e.toEvalError( this, callstack );
}
}
代码示例来源:origin: jitlogic/zorka
this.parent = parent;
if ( parent != null )
setStrictJava( parent.getStrictJava() );
this.sourceFileInfo = sourceFileInfo;
代码示例来源:origin: beanshell/beanshell
private void evalNodes( CallStack callstack, Interpreter interpreter )
throws EvalError
{
insureNodesParsed();
// validate that the throws names are class names
for(int i=firstThrowsClause; i<numThrows+firstThrowsClause; i++)
((BSHAmbiguousName)jjtGetChild(i)).toClass(
callstack, interpreter );
paramsNode.eval( callstack, interpreter );
// if strictJava mode, check for loose parameters and return type
if ( interpreter.getStrictJava() )
{
for(int i=0; i<paramsNode.paramTypes.length; i++)
if ( paramsNode.paramTypes[i] == null )
// Warning: Null callstack here. Don't think we need
// a stack trace to indicate how we sourced the method.
throw new EvalError(
"(Strict Java Mode) Undeclared argument type, parameter: " +
paramsNode.getParamNames()[i] + " in method: "
+ name, this, null );
if ( returnType == null )
// Warning: Null callstack here. Don't think we need
// a stack trace to indicate how we sourced the method.
throw new EvalError(
"(Strict Java Mode) Undeclared return type for method: "
+ name, this, null );
}
}
代码示例来源:origin: beanshell/beanshell
throws EvalError {
if ( !interpreter.getStrictJava() ) {
if ( ( interpreter.getStrictJava() || !(obj instanceof List) )
&& !cls.isArray() )
throw new EvalError("Not an array or List type", this, callstack );
if ( !interpreter.getStrictJava()
&& Types.isPropertyTypeEntryList(cls) ) {
Object key = ((SimpleNode) jjtGetChild(0)).eval(callstack, interpreter);
if ( !interpreter.getStrictJava() ) {
if ( 0 > index )
index = length + index;
代码示例来源:origin: jitlogic/zorka
public void evalNodes(BSHMethodDeclaration node)
throws EvalError
{
node.insureNodesParsed();
// validate that the throws names are class names
for(int i=node.firstThrowsClause; i<node.numThrows+node.firstThrowsClause; i++)
ambiguousNameToClass(((BSHAmbiguousName)node.jjtGetChild(i)) );
node.paramsNode.accept(this);
// if strictJava mode, check for loose parameters and return type
if ( interpreter.getStrictJava() )
{
for(int i=0; i<node.paramsNode.paramTypes.length; i++)
if ( node.paramsNode.paramTypes[i] == null )
// Warning: Null callstack here. Don't think we need
// a stack trace to indicate how we sourced the method.
throw new EvalError(
"(Strict Java Mode) Undeclared argument type, parameter: " +
node.paramsNode.getParamNames()[i] + " in method: "
+ node.name, node, null );
if ( node.returnType == null )
// Warning: Null callstack here. Don't think we need
// a stack trace to indicate how we sourced the method.
throw new EvalError(
"(Strict Java Mode) Undeclared return type for method: "
+ node.name, node, null );
}
}
代码示例来源:origin: jitlogic/zorka
if ( fp.type == null && interpreter.getStrictJava() )
throw new EvalError(
"(Strict Java) Untyped catch block", node, callstack );
代码示例来源:origin: beanshell/beanshell
if ( mc.isUntyped() && interpreter.getStrictJava() )
throw new EvalError(
"(Strict Java) Untyped catch block", this, callstack );
代码示例来源:origin: beanshell/beanshell
if ( interpreter.getStrictJava() )
throw new EvalError("No declared array type or dimensions.",
this, callstack );
代码示例来源:origin: beanshell/beanshell
namespace.setVariableImpl(var);
} else {
if (interpreter.getStrictJava()
&& value instanceof Primitive
&& ((Primitive) value).isNumber())
代码示例来源:origin: beanshell/beanshell
if ( interpreter.getStrictJava() && ( kind == PLUS || kind == STAR )
&& !( lhs instanceof String || rhs instanceof String ) )
throw new EvalError( "Bad operand types for binary operator "
代码示例来源:origin: beanshell/beanshell
localNameSpace.setLocalVariable(
paramNames[k], argValues[i],
interpreter.getStrictJava() );
} catch ( UtilEvalError e3 ) {
throw e3.toEvalError( "Typed method parameter assignment",
代码示例来源:origin: beanshell/beanshell
if (interpreter.getStrictJava())
ClassGeneratorUtil.checkAbstractMethodImplementation(genClass);
代码示例来源:origin: jitlogic/zorka
throw new InterpreterError( "Error, null LHSnode" );
boolean strictJava = interpreter.getStrictJava();
LHS lhs = primaryExprToLHS(lhsNode);
if ( lhs == null )
代码示例来源:origin: beanshell/beanshell
(BSHPrimaryExpression)jjtGetChild(0);
boolean strictJava = interpreter.getStrictJava();
LHS lhs = lhsNode.toLHS( callstack, interpreter);
代码示例来源:origin: jitlogic/zorka
localNameSpace.setLocalVariable(
paramNames[i], argValues[i],
visitor.getInterpreter().getStrictJava() );
} catch ( UtilEvalError e3 ) {
throw e3.toEvalError( callerInfo, visitor.getCallstack() );
内容来源于网络,如有侵权,请联系作者删除!