本文整理了Java中ch.qos.logback.core.subst.Node
类的一些代码示例,展示了Node
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node
类的具体详情如下:
包路径:ch.qos.logback.core.subst.Node
类名称:Node
暂无
代码示例来源:origin: camunda/camunda-bpm-platform
private Node makeNewLiteralNode(String s) {
return new Node(Node.Type.LITERAL, s);
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void dump() {
System.out.print(this.toString());
System.out.print(" -> ");
if(next != null) {
next.dump();
} else {
System.out.print(" null");
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Node node = (Node) o;
if (type != node.type) return false;
if (payload != null ? !payload.equals(node.payload) : node.payload != null) return false;
if (defaultPart != null ? !defaultPart.equals(node.defaultPart) : node.defaultPart != null) return false;
if (next != null ? !next.equals(node.next) : node.next != null) return false;
return true;
}
代码示例来源:origin: camunda/camunda-bpm-platform
void recursive(Node n, StringBuilder sb) {
Node c = n;
while (c != null) {
sb.append(c.toString()).append(" --> ");
c = c.next;
}
sb.append("null ");
}
代码示例来源:origin: camunda/camunda-bpm-platform
private Node E() throws ScanException {
Node t = T();
if (t == null) {
return null;
}
Node eOpt = Eopt();
if (eOpt != null) {
t.append(eOpt);
}
return t;
}
代码示例来源:origin: tony19/logback-android
@Test
public void literalWithTwoAccolades() throws ScanException {
Tokenizer tokenizer = new Tokenizer("%x{y} %a{b} c");
Parser parser = new Parser(tokenizer.tokenize());
Node node = parser.parse();
Node witness = new Node(Node.Type.LITERAL, "%x");
Node t = witness.next = new Node(Node.Type.LITERAL, "{");
t.next = new Node(Node.Type.LITERAL, "y");
t = t.next;
t.next = new Node(Node.Type.LITERAL, "}");
t = t.next;
t.next = new Node(Node.Type.LITERAL, " %a");
t = t.next;
t.next = new Node(Node.Type.LITERAL, "{");
t = t.next;
t.next = new Node(Node.Type.LITERAL, "b");
t = t.next;
t.next = new Node(Node.Type.LITERAL, "}");
t = t.next;
t.next = new Node(Node.Type.LITERAL, " c");
node.dump();
System.out.println("");
assertEquals(witness, node);
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (payload != null ? payload.hashCode() : 0);
result = 31 * result + (defaultPart != null ? defaultPart.hashCode() : 0);
result = 31 * result + (next != null ? next.hashCode() : 0);
return result;
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Override
public String toString() {
switch (type) {
case LITERAL:
return "Node{" +
"type=" + type +
", payload='" + payload +
"'}";
case VARIABLE:
StringBuilder payloadBuf = new StringBuilder();
StringBuilder defaultPartBuf2 = new StringBuilder();
if (defaultPart != null)
recursive((Node) defaultPart, defaultPartBuf2);
recursive((Node) payload, payloadBuf);
String r = "Node{" +
"type=" + type +
", payload='" + payloadBuf.toString()+"'";
if (defaultPart != null)
r += ", defaultPart=" + defaultPartBuf2.toString();
r += '}';
return r;
}
return null;
}
代码示例来源:origin: tony19/logback-android
void recursive(Node n, StringBuilder sb) {
Node c = n;
while (c != null) {
sb.append(c.toString()).append(" --> ");
c = c.next;
}
sb.append("null ");
}
代码示例来源:origin: camunda/camunda-bpm-platform
private Node C() throws ScanException {
Node e0 = E();
Token t = peekAtCurentToken();
if (isDefaultToken(t)) {
advanceTokenPointer();
Node literal = makeNewLiteralNode(CoreConstants.DEFAULT_VALUE_SEPARATOR);
e0.append(literal);
Node e1 = E();
e0.append(e1);
}
return e0;
}
代码示例来源:origin: tony19/logback-android
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (payload != null ? payload.hashCode() : 0);
result = 31 * result + (defaultPart != null ? defaultPart.hashCode() : 0);
result = 31 * result + (next != null ? next.hashCode() : 0);
return result;
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
@Override
public String toString() {
switch (type) {
case LITERAL:
return "Node{" + "type=" + type + ", payload='" + payload + "'}";
case VARIABLE:
StringBuilder payloadBuf = new StringBuilder();
StringBuilder defaultPartBuf2 = new StringBuilder();
if (defaultPart != null)
recursive((Node) defaultPart, defaultPartBuf2);
recursive((Node) payload, payloadBuf);
String r = "Node{" + "type=" + type + ", payload='" + payloadBuf.toString() + "'";
if (defaultPart != null)
r += ", defaultPart=" + defaultPartBuf2.toString();
r += '}';
return r;
}
return null;
}
代码示例来源:origin: tony19/logback-android
public void dump() {
System.out.print(this.toString());
System.out.print(" -> ");
if(next != null) {
next.dump();
} else {
System.out.print(" null");
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
private Node V() throws ScanException {
Node e = E();
Node variable = new Node(Node.Type.VARIABLE, e);
Token t = peekAtCurentToken();
if (isDefaultToken(t)) {
advanceTokenPointer();
Node def = E();
variable.defaultPart = def;
}
return variable;
}
代码示例来源:origin: ch.qos.logback/core
void recursive(Node n, StringBuilder sb) {
Node c = n;
while (c != null) {
sb.append(c.toString()).append(" --> ");
c = c.next;
}
sb.append("null ");
}
代码示例来源:origin: camunda/camunda-bpm-platform
private Node T() throws ScanException {
Token t = peekAtCurentToken();
switch (t.type) {
case LITERAL:
advanceTokenPointer();
return makeNewLiteralNode(t.payload);
case CURLY_LEFT:
advanceTokenPointer();
Node innerNode = C();
Token right = peekAtCurentToken();
expectCurlyRight(right);
advanceTokenPointer();
Node curlyLeft = makeNewLiteralNode(CoreConstants.LEFT_ACCOLADE);
curlyLeft.append(innerNode);
curlyLeft.append(makeNewLiteralNode(CoreConstants.RIGHT_ACCOLADE));
return curlyLeft;
case START:
advanceTokenPointer();
Node v = V();
Token w = peekAtCurentToken();
expectCurlyRight(w);
advanceTokenPointer();
return v;
default:
return null;
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
@Override
public int hashCode() {
int result = type != null ? type.hashCode() : 0;
result = 31 * result + (payload != null ? payload.hashCode() : 0);
result = 31 * result + (defaultPart != null ? defaultPart.hashCode() : 0);
result = 31 * result + (next != null ? next.hashCode() : 0);
return result;
}
}
代码示例来源:origin: tony19/logback-android
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Node node = (Node) o;
if (type != node.type) return false;
if (payload != null ? !payload.equals(node.payload) : node.payload != null) return false;
if (defaultPart != null ? !defaultPart.equals(node.defaultPart) : node.defaultPart != null) return false;
if (next != null ? !next.equals(node.next) : node.next != null) return false;
return true;
}
代码示例来源:origin: Nextdoor/bender
@Override
public String toString() {
switch (type) {
case LITERAL:
return "Node{" + "type=" + type + ", payload='" + payload + "'}";
case VARIABLE:
StringBuilder payloadBuf = new StringBuilder();
StringBuilder defaultPartBuf2 = new StringBuilder();
if (defaultPart != null)
recursive((Node) defaultPart, defaultPartBuf2);
recursive((Node) payload, payloadBuf);
String r = "Node{" + "type=" + type + ", payload='" + payloadBuf.toString() + "'";
if (defaultPart != null)
r += ", defaultPart=" + defaultPartBuf2.toString();
r += '}';
return r;
}
return null;
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
public void dump() {
System.out.print(this.toString());
System.out.print(" -> ");
if (next != null) {
next.dump();
} else {
System.out.print(" null");
}
}
内容来源于网络,如有侵权,请联系作者删除!