ch.qos.logback.core.pattern.parser.Node.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(242)

本文整理了Java中ch.qos.logback.core.pattern.parser.Node.<init>()方法的一些代码示例,展示了Node.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.<init>()方法的具体详情如下:
包路径:ch.qos.logback.core.pattern.parser.Node
类名称:Node
方法名:<init>

Node.<init>介绍

暂无

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: tony19/logback-android

  1. @Test
  2. public void keywordGluedToLitteral() throws Exception {
  3. Parser<Object> p = new Parser("%x{}a");
  4. Node t = p.parse();
  5. SimpleKeywordNode witness = new SimpleKeywordNode("x");
  6. witness.setOptions(new ArrayList<String>());
  7. witness.next = new Node(Node.LITERAL, "a");
  8. assertEquals(witness, t);
  9. }

代码示例来源:origin: tony19/logback-android

  1. @Test
  2. public void testCompositeFormatting() throws Exception {
  3. Parser<Object> p = new Parser("hello%5(XYZ)");
  4. Node t = p.parse();
  5. Node witness = new Node(Node.LITERAL, "hello");
  6. CompositeNode composite = new CompositeNode(BARE);
  7. composite.setFormatInfo(new FormatInfo(5, Integer.MAX_VALUE));
  8. Node child = new Node(Node.LITERAL, "XYZ");
  9. composite.setChildNode(child);
  10. witness.next = composite;
  11. assertEquals(witness, t);
  12. }

代码示例来源:origin: tony19/logback-android

  1. @Test
  2. public void testKeyword() throws Exception {
  3. {
  4. Parser<Object> p = new Parser("hello%xyz");
  5. Node t = p.parse();
  6. Node witness = new Node(Node.LITERAL, "hello");
  7. witness.next = new SimpleKeywordNode("xyz");
  8. assertEquals(witness, t);
  9. }
  10. {
  11. Parser<Object> p = new Parser("hello%xyz{x}");
  12. Node t = p.parse();
  13. Node witness = new Node(Node.LITERAL, "hello");
  14. SimpleKeywordNode n = new SimpleKeywordNode("xyz");
  15. List<String> optionList = new ArrayList<String>();
  16. optionList.add("x");
  17. n.setOptions(optionList);
  18. witness.next = n;
  19. assertEquals(witness, t);
  20. }
  21. }

代码示例来源:origin: tony19/logback-android

  1. Node witness = new Node(Node.LITERAL, "hello");
  2. CompositeNode composite = new CompositeNode(BARE);
  3. Node child = new SimpleKeywordNode("child");
  4. Node witness = new Node(Node.LITERAL, "hello");
  5. CompositeNode composite = new CompositeNode(BARE);
  6. Node child = new SimpleKeywordNode("child");
  7. composite.setChildNode(child);
  8. witness.next = composite;
  9. child.next = new Node(Node.LITERAL, " ");
  10. assertEquals(witness, t);
  11. Node witness = new Node(Node.LITERAL, "hello");
  12. CompositeNode composite = new CompositeNode(BARE);
  13. Node child = new SimpleKeywordNode("child");
  14. composite.setChildNode(child);
  15. child.next = new Node(Node.LITERAL, " ");
  16. child.next.next = new SimpleKeywordNode("h");
  17. witness.next = composite;
  18. Node witness = new Node(Node.LITERAL, "hello");
  19. CompositeNode composite = new CompositeNode(BARE);
  20. Node child = new SimpleKeywordNode("child");
  21. composite.setChildNode(child);
  22. child.next = new Node(Node.LITERAL, " ");
  23. child.next.next = new SimpleKeywordNode("h");
  24. witness.next = composite;
  25. composite.next = new Node(Node.LITERAL, " ");
  26. composite.next.next = new SimpleKeywordNode("m");

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

  1. case Token.LITERAL:
  2. advanceTokenPointer();
  3. return new Node(Node.LITERAL, t.getValue());
  4. case Token.PERCENT:
  5. advanceTokenPointer();

代码示例来源:origin: tony19/logback-android

  1. @Test
  2. public void testNested() throws Exception {
  3. {
  4. Parser<Object> p = new Parser("%top %(%child%(%h))");
  5. Node t = p.parse();
  6. Node witness = new SimpleKeywordNode("top");
  7. Node w = witness.next = new Node(Node.LITERAL, " ");
  8. CompositeNode composite = new CompositeNode(BARE);
  9. w = w.next = composite;
  10. Node child = new SimpleKeywordNode("child");
  11. composite.setChildNode(child);
  12. composite = new CompositeNode(BARE);
  13. child.next = composite;
  14. composite.setChildNode(new SimpleKeywordNode("h"));
  15. assertEquals(witness, t);
  16. }
  17. }

代码示例来源:origin: tony19/logback-android

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: ch.qos.logback/core

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: com.hynnet/logback-core

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: io.virtdata/virtdata-lib-realer

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: Nextdoor/bender

  1. Node T() throws ScanException {
  2. Token t = getCurentToken();
  3. expectNotNull(t, "a LITERAL or '%'");
  4. switch (t.getType()) {
  5. case Token.LITERAL:
  6. advanceTokenPointer();
  7. return new Node(Node.LITERAL, t.getValue());
  8. case Token.PERCENT:
  9. advanceTokenPointer();
  10. // System.out.println("% token found");
  11. FormatInfo fi;
  12. Token u = getCurentToken();
  13. FormattingNode c;
  14. expectNotNull(u, "a FORMAT_MODIFIER, SIMPLE_KEYWORD or COMPOUND_KEYWORD");
  15. if (u.getType() == Token.FORMAT_MODIFIER) {
  16. fi = FormatInfo.valueOf((String) u.getValue());
  17. advanceTokenPointer();
  18. c = C();
  19. c.setFormatInfo(fi);
  20. } else {
  21. c = C();
  22. }
  23. return c;
  24. default:
  25. return null;
  26. }
  27. }

代码示例来源:origin: tony19/logback-android

  1. FormattingNode witness = new SimpleKeywordNode("x");
  2. witness.setFormatInfo(new FormatInfo(4, 5, false, true));
  3. Node n = witness.next = new Node(Node.LITERAL, " ");
  4. n = n.next = new SimpleKeywordNode("y");
  5. ((FormattingNode) n).setFormatInfo(new FormatInfo(12, Integer.MAX_VALUE));

相关文章