本文整理汇总了Java中org.mozilla.javascript.Token.COLON属性的典型用法代码示例。如果您正苦于以下问题:Java Token.COLON属性的具体用法?Java Token.COLON怎么用?Java Token.COLON使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.mozilla.javascript.Token
的用法示例。
在下文中一共展示了Token.COLON属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toSource
@Override
public String toSource(int depth) {
StringBuilder sb = new StringBuilder();
sb.append("\n");
sb.append(makeIndent(depth+1));
if (isGetterMethod()) {
sb.append("get ");
} else if (isSetterMethod()) {
sb.append("set ");
}
sb.append(left.toSource(getType()==Token.COLON ? 0 : depth));
if (type == Token.COLON) {
sb.append(": ");
}
sb.append(right.toSource(getType()==Token.COLON ? 0 : depth+1));
return sb.toString();
}
示例2: toSource
@Override
public String toSource(int depth) {
StringBuilder sb = new StringBuilder();
sb.append(makeIndent(depth));
if (isGetter()) {
sb.append("get ");
} else if (isSetter()) {
sb.append("set ");
}
sb.append(left.toSource(0));
if (type == Token.COLON) {
sb.append(": ");
}
sb.append(right.toSource(0));
return sb.toString();
}
示例3: toSource
@Override
public String toSource(int depth) {
StringBuilder sb = new StringBuilder();
sb.append("\n");
sb.append(makeIndent(depth+1));
if (isGetter()) {
sb.append("get ");
} else if (isSetter()) {
sb.append("set ");
}
sb.append(left.toSource(getType()==Token.COLON ? 0 : depth));
if (type == Token.COLON) {
sb.append(": ");
}
sb.append(right.toSource(getType()==Token.COLON ? 0 : depth+1));
return sb.toString();
}
示例4: setNodeType
/**
* Sets the node type. Must be one of
* {@link Token#COLON}, {@link Token#GET}, or {@link Token#SET}.
* @throws IllegalArgumentException if {@code nodeType} is invalid
*/
public void setNodeType(int nodeType) {
if (nodeType != Token.COLON
&& nodeType != Token.GET
&& nodeType != Token.SET
&& nodeType != Token.METHOD)
throw new IllegalArgumentException("invalid node type: "
+ nodeType);
setType(nodeType);
}
示例5: setNodeType
/**
* Sets the node type. Must be one of
* {@link Token#COLON}, {@link Token#GET}, or {@link Token#SET}.
* @throws IllegalArgumentException if {@code nodeType} is invalid
*/
public void setNodeType(int nodeType) {
if (nodeType != Token.COLON
&& nodeType != Token.GET
&& nodeType != Token.SET)
throw new IllegalArgumentException("invalid node type: "
+ nodeType);
setType(nodeType);
}