Examples of PatternParser


Examples of net.infopeers.restrant.engine.parser.PatternParser

   
    TestParams params = new TestParams();
    String format = "/:controller/:action/:id";
    String path = "/con/act/uid";

    PatternParser parser = new TextUrlParser(format, phFormatter);
    assertTrue(parser.parse(params, path));
   
    assertEquals("con", params.get("controller"));
    assertEquals("act", params.get("action"));
    assertEquals("uid", params.get("id"));
  }
View Full Code Here

Examples of net.sf.clairv.search.pattern.bnf.PatternParser

    this.indexReader = indexReader;
  }

  public ResultPattern createResultPattern(String pattern) {
    PatternParser parser;
    try {
      parser = new PatternParser(new ByteArrayInputStream(pattern
          .getBytes("UTF-8")), "UTF-8");
    } catch (UnsupportedEncodingException e1) {
      log.error("Cannot encode pattern as UTF-8");
      return null;
    }
    AstTree ast;
    try {
      parser.setFunctionLookupTable(this.functionMap);
      ast = parser.parse();
      ResultPattern rp = new ResultPattern(ast, indexReader);
      return rp;
    } catch (ParseException e) {
      log.error("Syntax error in the pattern: " + pattern);
      return null;
View Full Code Here

Examples of org.apache.felix.karaf.shell.log.layout.PatternParser

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    protected Object doExecute() throws Exception {
        PatternConverter cnv = new PatternParser(overridenPattern != null ? overridenPattern : pattern).parse();

        Iterable<PaxLoggingEvent> le = events.getElements(entries == 0 ? Integer.MAX_VALUE : entries);
        StringBuffer sb = new StringBuffer();
        for (PaxLoggingEvent event : le) {
            sb.setLength(0);
View Full Code Here

Examples of org.apache.karaf.log.core.internal.layout.PatternParser

    /* (non-Javadoc)
     * @see org.apache.karaf.log.core.internal.LogEventFormatter#format(org.ops4j.pax.logging.spi.PaxLoggingEvent, java.lang.String, boolean)
     */
    @Override
    public String format(PaxLoggingEvent event, String overridenPattern, boolean noColor) {
        final PatternConverter cnv = new PatternParser(overridenPattern != null ? overridenPattern : pattern).parse();
        String color = getColor(event, noColor);
        StringBuffer sb = new StringBuffer();
        sb.setLength(0);
        if (color != null) {
            sb.append(FIRST_ESC_CHAR);
View Full Code Here

Examples of org.apache.karaf.shell.log.layout.PatternParser

    public void setTraceColor(String traceColor) {
        this.traceColor = traceColor;
    }

    protected Object doExecute() throws Exception {
        final PatternConverter cnv = new PatternParser(overridenPattern != null ? overridenPattern : pattern).parse();
        final PrintStream out = System.out;

        Iterable<PaxLoggingEvent> le = events.getElements(entries == 0 ? Integer.MAX_VALUE : entries);
        for (PaxLoggingEvent event : le) {
            display(cnv, event, out);
View Full Code Here

Examples of org.apache.karaf.shell.log.layout.PatternParser

    class PrintEventThread implements Runnable {

        boolean doDisplay = true;

        public void run() {
            final PatternConverter cnv = new PatternParser(overridenPattern != null ? overridenPattern : pattern).parse();
            final PrintStream out = System.out;

            Iterable<PaxLoggingEvent> le = events.getElements(entries == 0 ? Integer.MAX_VALUE : entries);
            for (PaxLoggingEvent event : le) {
                display(cnv, event, out);
View Full Code Here

Examples of org.apache.log4j.helpers.PatternParser

    custom conversion characters.

    @since 0.9.0
  */
  protected PatternParser createPatternParser(String pattern) {
    return new PatternParser(pattern);
  }
View Full Code Here

Examples of org.apache.log4j.helpers.PatternParser

    }

    /* Note: why is this public? The super class's method is protected */
    public PatternParser createPatternParser (String pattern)
    {
        PatternParser result;
        if (pattern == null) {
            result = new StandardPatternParser(DefaultLogPattern);
        }
        else {
            result = new StandardPatternParser(pattern);
View Full Code Here

Examples of org.apache.log4j.helpers.PatternParser

    }

    @Override
    public PatternParser createPatternParser(String pattern)
    {
        PatternParser parser;
        if (pattern == null)
            parser = new PatternParser(DEFAULT_CONVERSION_PATTERN);
        else
            parser = new PatternParser(pattern);

        return parser;
    }
View Full Code Here

Examples of org.apache.log4j.helpers.PatternParser

        super(pattern);
    }

    public PatternParser createPatternParser(String pattern)
    {
        PatternParser parser;
        if (pattern == null)
            parser = new CustomPatternParser(DEFAULT_CONVERSION_PATTERN);
        else
            parser = new CustomPatternParser(pattern);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.