本文整理汇总了Java中org.mozilla.javascript.Token.FALSE属性的典型用法代码示例。如果您正苦于以下问题:Java Token.FALSE属性的具体用法?Java Token.FALSE怎么用?Java Token.FALSE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.mozilla.javascript.Token
的用法示例。
在下文中一共展示了Token.FALSE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toSource
@Override
public String toSource(int depth) {
StringBuilder sb = new StringBuilder();
sb.append(makeIndent(depth));
switch (getType()) {
case Token.THIS:
sb.append("this");
break;
case Token.NULL:
sb.append("null");
break;
case Token.TRUE:
sb.append("true");
break;
case Token.FALSE:
sb.append("false");
break;
case Token.DEBUGGER:
sb.append("debugger;\n");
break;
default:
throw new IllegalStateException("Invalid keyword literal type: "
+ getType());
}
return sb.toString();
}
示例2: toSource
@Override
public String toSource(int depth) {
StringBuilder sb = new StringBuilder();
sb.append(makeIndent(depth));
switch (getType()) {
case Token.THIS:
sb.append("this");
break;
case Token.NULL:
sb.append("null");
break;
case Token.TRUE:
sb.append("true");
break;
case Token.FALSE:
sb.append("false");
break;
case Token.DEBUGGER:
sb.append("debugger");
break;
default:
throw new IllegalStateException("Invalid keyword literal type: "
+ getType());
}
return sb.toString();
}
示例3: setType
/**
* Sets node token type
* @throws IllegalArgumentException if {@code nodeType} is unsupported
*/
@Override
public KeywordLiteral setType(int nodeType) {
if (!(nodeType == Token.THIS
|| nodeType == Token.NULL
|| nodeType == Token.TRUE
|| nodeType == Token.FALSE
|| nodeType == Token.DEBUGGER))
throw new IllegalArgumentException("Invalid node type: "
+ nodeType);
type = nodeType;
return this;
}
示例4: processChild
/**
* process child node
*
* @param parent
* @param child
* @param tree
* @param columnExprList
* @throws BirtException
*/
private void processChild( Node child, ScriptNode tree,
List columnExprList ) throws BirtException
{
switch ( child.getType( ) )
{
case Token.NUMBER :
case Token.STRING :
case Token.NULL :
case Token.TRUE :
case Token.FALSE :
break;
case Token.GETPROP :
case Token.GETELEM :
case Token.SETPROP :
case Token.SETELEM :
{
compileDirectColRefExpr( child, tree, columnExprList );
break;
}
case Token.CALL :
compileAggregateExpr( child, tree, columnExprList );
break;
default :
compileComplexExpr( child, tree, columnExprList );
}
}
示例5: compileComplexExpr
/**
* compile the complex expression
*
* @param complexNode
* @throws BirtException
*/
private void compileComplexExpr( Node complexNode, ScriptNode tree,
List columnExprList ) throws BirtException
{
Node child = complexNode.getFirstChild( );
while ( child != null )
{
if ( child.getType( ) == Token.FUNCTION )
{
int index = getFunctionIndex( child.getString( ), tree );
compileFunctionNode( tree.getFunctionNode( index ),
tree,
columnExprList );
}
// keep reference to next child, since subsequent steps could
// lose
// the reference to it
Node nextChild = child.getNext( );
// do not include constants into the sub-expression list
if ( child.getType( ) == Token.NUMBER
|| child.getType( ) == Token.STRING
|| child.getType( ) == Token.TRUE
|| child.getType( ) == Token.FALSE
|| child.getType( ) == Token.NULL )
{
processChild( child, tree, columnExprList );
child = nextChild;
continue;
}
processChild( child, tree, columnExprList );
child = nextChild;
}
}
示例6: processChild
/**
*
* returns the compiled expression from processing a child node
*
* @param context
* @param customerChecked
* @param parent
* @param child
* @return
* @throws DataException
*/
protected CompiledExpression processChild( Context context,
boolean customerChecked, Node parent, Node child, Node grandFather )
throws DataException
{
CompiledExpression compiledExpr = null;
switch ( child.getType( ) )
{
case Token.NUMBER :
compiledExpr = new ConstantExpression( child.getDouble( ) );
break;
case Token.STRING :
compiledExpr = new ConstantExpression( child.getString( ) );
break;
case Token.NULL :
compiledExpr = new ConstantExpression( );
break;
case Token.TRUE :
compiledExpr = new ConstantExpression( true );
break;
case Token.FALSE :
compiledExpr = new ConstantExpression( false );
break;
case Token.GETPROP :
{
ConstantExpression ce = AggregationConstantsUtil.getConstantExpression( child );
if ( ce != null )
{
compiledExpr = ce;
break;
}
}
case Token.GETELEM :
compiledExpr = compileDirectColRefExpr( parent,
child,
grandFather,
customerChecked,
context );
break;
case Token.CALL :
{
compiledExpr = compileAggregateExpr( context, parent, child );
break;
}
}
if ( compiledExpr == null )
compiledExpr = compileComplexExpr( context, child, customerChecked );
return compiledExpr;
}
示例7: isBooleanLiteral
/**
* Returns true if the token type is {@link Token#TRUE} or
* {@link Token#FALSE}.
*/
public boolean isBooleanLiteral() {
return type == Token.TRUE || type == Token.FALSE;
}