congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NodeToStringTransformer
Code IndexAdd Tabnine to your IDE (free)

How to use
NodeToStringTransformer
in
ch.qos.logback.core.subst

Best Java code snippets using ch.qos.logback.core.subst.NodeToStringTransformer (Showing top 20 results out of 315)

origin: camunda/camunda-bpm-platform

public static String substituteVariable(String input, PropertyContainer pc0, PropertyContainer pc1) throws ScanException {
 Node node = tokenizeAndParseString(input);
 NodeToStringTransformer nodeToStringTransformer = new NodeToStringTransformer(node, pc0, pc1);
 return nodeToStringTransformer.transform();
}
origin: camunda/camunda-bpm-platform

private void handleVariable(Node n, StringBuilder stringBuilder, Stack<Node> cycleCheckStack) throws ScanException {
 if (haveVisitedNodeAlready(n, cycleCheckStack)) {
  cycleCheckStack.push(n);
  String error = constructRecursionErrorMessage(cycleCheckStack);
  throw new IllegalArgumentException(error);
 compileNode(payload, keyBuffer, cycleCheckStack);
 String key = keyBuffer.toString();
 String value = lookupKey(key);
  Node innerNode = tokenizeAndParseString(value);
  compileNode(innerNode, stringBuilder, cycleCheckStack);
  cycleCheckStack.pop();
  return;
 compileNode(defaultPart, defaultPartBuffer, cycleCheckStack);
 cycleCheckStack.pop();
 String defaultVal = defaultPartBuffer.toString();
origin: camunda/camunda-bpm-platform

private void compileNode(Node inputNode, StringBuilder stringBuilder, Stack<Node> cycleCheckStack) throws ScanException {
 Node n = inputNode;
 while (n != null) {
  switch (n.type) {
   case LITERAL:
    handleLiteral(n, stringBuilder);
    break;
   case VARIABLE:
    handleVariable(n, stringBuilder, cycleCheckStack);
    break;
  }
  n = n.next;
 }
}
origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

public static String substituteVariable(String input, PropertyContainer pc0, PropertyContainer pc1) throws ScanException {
 Tokenizer tokenizer = new Tokenizer(input);
 Parser parser = new Parser(tokenizer.tokenize());
 Node node = parser.parse();
 NodeToStringTransformer nodeToStringTransformer = new NodeToStringTransformer(node, pc0, pc1);
 return nodeToStringTransformer.transform();
}
origin: camunda/camunda-bpm-platform

/**
 * See  http://logback.qos.ch/manual/configuration.html#variableSubstitution
 */
public static String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) {
 try {
  return NodeToStringTransformer.substituteVariable(input, pc0, pc1);
 } catch (ScanException e) {
  throw new IllegalArgumentException("Failed to parse input [" + input + "]", e);
 }
}
origin: camunda/camunda-bpm-platform

public String transform() throws ScanException {
 StringBuilder stringBuilder = new StringBuilder();
 compileNode(node, stringBuilder, new Stack<Node>());
 return stringBuilder.toString();
}
origin: ch.qos.logback/core

private void handleVariable(Node n, StringBuilder stringBuilder) {
 StringBuilder keyBuffer = new StringBuilder();
 Node payload = (Node) n.payload;
 compileNode(payload, keyBuffer);
 String key = keyBuffer.toString();
 String value = lookupKey(key);
 if (value != null) {
  stringBuilder.append(value);
  return;
 }
 if (n.defaultPart == null) {
  stringBuilder.append(key + CoreConstants.UNDEFINED_PROPERTY_SUFFIX);
  return;
 }
 Node defaultPart = (Node) n.defaultPart;
 StringBuilder defaultPartBuffer = new StringBuilder();
 compileNode(defaultPart, defaultPartBuffer);
 String defaultVal = defaultPartBuffer.toString();
 stringBuilder.append(defaultVal);
}
origin: camunda/camunda-bpm-platform

/**
 * Determine if a node has already been visited already by checking the cycleDetectionStack
 * for it's existence. This method is used -- rather than Stack.contains() -- because
 * we want to ignore the Node's 'next' attribute when comparing for equality.
 */
private boolean haveVisitedNodeAlready(Node node, Stack<Node> cycleDetectionStack) {
 for (Node cycleNode : cycleDetectionStack) {
  if (equalNodes(node, cycleNode)) {
   return true;
  }
 }
 return false;
}
private boolean equalNodes(Node node1, Node node2) {
origin: ch.qos.logback/core

public static String substituteVariable(String input, PropertyContainer pc0, PropertyContainer pc1) throws ScanException {
 Tokenizer tokenizer = new Tokenizer(input);
 Parser parser = new Parser(tokenizer.tokenize());
 Node node = parser.parse();
 NodeToStringTransformer nodeToStringTransformer = new NodeToStringTransformer(node, pc0, pc1);
 return nodeToStringTransformer.transform();
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * See  http://logback.qos.ch/manual/configuration.html#variableSubstitution
 */
public static String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) {
  try {
    return NodeToStringTransformer.substituteVariable(input, pc0, pc1);
  } catch (ScanException e) {
    throw new IllegalArgumentException("Failed to parse input [" + input + "]", e);
  }
}
origin: ch.qos.logback/core

public String transform() {
 StringBuilder stringBuilder = new StringBuilder();
 compileNode(node, stringBuilder);
 return stringBuilder.toString();
}
origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

private void handleVariable(Node n, StringBuilder stringBuilder) {
 StringBuilder keyBuffer = new StringBuilder();
 Node payload = (Node) n.payload;
 compileNode(payload, keyBuffer);
 String key = keyBuffer.toString();
 String value = lookupKey(key);
 if (value != null) {
  stringBuilder.append(value);
  return;
 }
 if (n.defaultPart == null) {
  stringBuilder.append(key + CoreConstants.UNDEFINED_PROPERTY_SUFFIX);
  return;
 }
 Node defaultPart = (Node) n.defaultPart;
 StringBuilder defaultPartBuffer = new StringBuilder();
 compileNode(defaultPart, defaultPartBuffer);
 String defaultVal = defaultPartBuffer.toString();
 stringBuilder.append(defaultVal);
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Determine if a node has already been visited already by checking the cycleDetectionStack
 * for it's existence. This method is used -- rather than Stack.contains() -- because
 * we want to ignore the Node's 'next' attribute when comparing for equality.
 */
private boolean haveVisitedNodeAlready(Node node, Stack<Node> cycleDetectionStack) {
  for (Node cycleNode : cycleDetectionStack) {
    if (equalNodes(node, cycleNode)) {
      return true;
    }
  }
  return false;
}
origin: io.virtdata/virtdata-lib-realer

private void handleVariable(Node n, StringBuilder stringBuilder, Stack<Node> cycleCheckStack) throws ScanException {
  if (haveVisitedNodeAlready(n, cycleCheckStack)) {
    cycleCheckStack.push(n);
    String error = constructRecursionErrorMessage(cycleCheckStack);
    throw new IllegalArgumentException(error);
  compileNode(payload, keyBuffer, cycleCheckStack);
  String key = keyBuffer.toString();
  String value = lookupKey(key);
    Node innerNode = tokenizeAndParseString(value);
    compileNode(innerNode, stringBuilder, cycleCheckStack);
    cycleCheckStack.pop();
    return;
  compileNode(defaultPart, defaultPartBuffer, cycleCheckStack);
  cycleCheckStack.pop();
  String defaultVal = defaultPartBuffer.toString();
origin: tony19/logback-android

void checkInputEqualsOutput(String input) throws ScanException {
 Node node = makeNode(input);
 NodeToStringTransformer nodeToStringTransformer = new NodeToStringTransformer(node, propertyContainer0);
 assertEquals(input, nodeToStringTransformer.transform());
}
origin: tony19/logback-android

public static String substituteVariable(String input, PropertyContainer pc0, PropertyContainer pc1) throws ScanException {
 Node node = tokenizeAndParseString(input);
 NodeToStringTransformer nodeToStringTransformer = new NodeToStringTransformer(node, pc0, pc1);
 return nodeToStringTransformer.transform();
}
origin: tony19/logback-android

private void compileNode(Node inputNode, StringBuilder stringBuilder, Stack<Node> cycleCheckStack) throws ScanException {
 Node n = inputNode;
 while (n != null) {
  switch (n.type) {
   case LITERAL:
    handleLiteral(n, stringBuilder);
    break;
   case VARIABLE:
    handleVariable(n, stringBuilder, cycleCheckStack);
    break;
  }
  n = n.next;
 }
}
origin: io.virtdata/virtdata-lib-realer

/**
 * See  http://logback.qos.ch/manual/configuration.html#variableSubstitution
 */
public static String substVars(String input, PropertyContainer pc0, PropertyContainer pc1) {
  try {
    return NodeToStringTransformer.substituteVariable(input, pc0, pc1);
  } catch (ScanException e) {
    throw new IllegalArgumentException("Failed to parse input [" + input + "]", e);
  }
}
origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

public String transform() {
 StringBuilder stringBuilder = new StringBuilder();
 compileNode(node, stringBuilder);
 return stringBuilder.toString();
}
origin: Nextdoor/bender

/**
 * Determine if a node has already been visited already by checking the cycleDetectionStack
 * for it's existence. This method is used -- rather than Stack.contains() -- because
 * we want to ignore the Node's 'next' attribute when comparing for equality.
 */
private boolean haveVisitedNodeAlready(Node node, Stack<Node> cycleDetectionStack) {
  for (Node cycleNode : cycleDetectionStack) {
    if (equalNodes(node, cycleNode)) {
      return true;
    }
  }
  return false;
}
ch.qos.logback.core.substNodeToStringTransformer

Javadoc

Compiles a previously parsed Node chain into a String.

Most used methods

  • <init>
  • transform
  • compileNode
  • handleLiteral
  • handleVariable
  • lookupKey
  • substituteVariable
  • constructRecursionErrorMessage
  • equalNodes
  • haveVisitedNodeAlready
    Determine if a node has already been visited already by checking the cycleDetectionStack for it's ex
  • tokenizeAndParseString
  • variableNodeValue
  • tokenizeAndParseString,
  • variableNodeValue

Popular in Java

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now