Package org.jboss.seam.text

Examples of org.jboss.seam.text.SeamTextLexer


        log.debug("completed validation of text editor value for key: " + key);
    }

    protected SeamTextParser getValidationParser(String text) {
        Reader r = new StringReader(text);
        SeamTextLexer lexer = new SeamTextLexer(r);
        SeamTextParser parser = new SeamTextParser(lexer);
        parser.setSanitizer(
            new SeamTextParser.DefaultSanitizer() {
                @Override
                public void validateLinkTagURI(Token token, String s) throws SemanticException {
View Full Code Here


    private List<WikiLink> externalLinks = new ArrayList<WikiLink>();
    private Set<String> macroNames = new HashSet<String>();
    private boolean renderDuplicateMacros;

    public WikiTextParser(String wikiText, boolean renderDuplicateMacros, boolean resolveLinks) {
        super(new SeamTextLexer(new StringReader(wikiText)));
        this.renderDuplicateMacros = renderDuplicateMacros;
        this.resolveLinks = resolveLinks;

        setSanitizer(
            new DefaultSanitizer() {
View Full Code Here

    if (value == null) {
      return "";
    }
    try {
      Reader r = new StringReader(value.toString());
      SeamTextLexer lexer = new SeamTextLexer(r);
      SeamTextParser parser = new SeamTextParser(lexer);
      parser.startRule();
      return parser.toString();

    } catch (Exception e) {
View Full Code Here

     * @param text the raw markup text
     * @return an instance of <tt>SeamTextParser</tt>
     */
    public SeamTextParser getSeamTextParser(String text) {
       Reader r = new StringReader(text);
       SeamTextLexer lexer = new SeamTextLexer(r);
       return new SeamTextParser(lexer);
    }
View Full Code Here

  
   public String getFormattedText()
   {
      if ( getValue() == null) return null;
      Reader r = new StringReader( (String) getValue() );
      SeamTextLexer lexer = new SeamTextLexer(r);
      SeamTextParser parser = new SeamTextParser(lexer);
      try
      {
         parser.startRule();
      }
View Full Code Here

public class SeamTextTest
{
    public static void main(String[] args) throws Exception {
        Reader r = new InputStreamReader( SeamTextTest.class.getResourceAsStream("SeamTextTest.txt") );
        SeamTextLexer lexer = new SeamTextLexer(r);
        SeamTextParser parser = new SeamTextParser(lexer);
        parser.startRule();
        System.out.println(parser);
    }
View Full Code Here

            throw new IllegalArgumentException("Value is not a string: "
                    + value);
        }
        String text = (String) value;
        Reader r = new StringReader(text);
        SeamTextLexer lexer = new SeamTextLexer(r);
        SeamTextParser parser = new SeamTextParser(lexer);
        try {
            parser.startRule();
        }
        // Error handling for ANTLR lexer/parser errors, see
View Full Code Here

        System.out.println("------------------- SeamText -------------------");
        final String seamText = convertHtmlToSeamText(htmlText);
        System.out.println("seamText = \n'" + seamText + "'");
       
        final SeamTextParser seamParser =
            new SeamTextParser(new SeamTextLexer(new StringReader(seamText)));
        seamParser.startRule();
       
        final String string = seamParser.toString();
        System.out.println("------------------- Html -----------------------");
        System.out.println("html = " + string);
View Full Code Here

   
    private void assertSeamConverting(String seamTextExpression)
            throws TokenStreamException, RecognitionException {
        System.out.println("SeamText -> Html -> SeamText");
        System.out.println("------------------- SeamText -------------------");
        final SeamTextParser seamParser = new SeamTextParser(new SeamTextLexer(
                new StringReader(seamTextExpression)));
        seamParser.startRule();
       
        System.out.println("------------------- Html -----------------------");
        final String html = seamParser.toString();
View Full Code Here

   @Override
   public void encodeBegin(FacesContext context) throws IOException
   {
      if ( !isRendered() || getValue() == null) return;
      Reader r = new StringReader( (String) getValue() );
      SeamTextLexer lexer = new SeamTextLexer(r);
      SeamTextParser parser = new SeamTextParser(lexer);
      try
      {
         parser.startRule();
      }
View Full Code Here

TOP

Related Classes of org.jboss.seam.text.SeamTextLexer

Copyright © 2018 www.massapicom. 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.