Package org.apache.wicket.markup

Examples of org.apache.wicket.markup.MarkupParser


  private static boolean compareMarkup(final String a, final String b)
  {
    try
    {
      // Parse a and b into markup and compare
      final Markup amarkup = new MarkupParser(new XmlPullParser()).parse(a);
      final Markup bmarkup = new MarkupParser(new XmlPullParser()).parse(b);
      return amarkup.equalTo(bmarkup);
    }
    catch (IOException e)
    {
      e.printStackTrace();
View Full Code Here


    pageSettings.addComponentResolver(new MessageResolver());
    pageSettings.addComponentResolver(new MessageTagHandler());
    getMarkupSettings().setMarkupFactory(new MarkupFactory(){
      @Override
      public MarkupParser newMarkupParser(MarkupResourceStream resource) {
        MarkupParser mp = super.newMarkupParser(resource);
        mp.add(new MessageTagHandler());
        return mp;
      }
    });
   
    //Add custom resource loader at the beginning, so it will be checked first in the
View Full Code Here

        // still work. WICKET-3700
        ContainerInfo containerInfo = new ContainerInfo(page);
        MarkupResourceStream markupResourceStream = new MarkupResourceStream(
          new StringResourceStream(markup), containerInfo, page.getClass());

        MarkupParser markupParser = getApplication().getMarkupSettings()
          .getMarkupFactory()
          .newMarkupParser(markupResourceStream);
        pageMarkup = markupParser.parse();
      }
      catch (Exception e)
      {
        fail("Error while parsing the markup for the autogenerated page: " + e.getMessage());
      }
View Full Code Here

        // still work. WICKET-3700
        ContainerInfo containerInfo = new ContainerInfo(page);
        MarkupResourceStream markupResourceStream = new MarkupResourceStream(
          new StringResourceStream(markup), containerInfo, page.getClass());

        MarkupParser markupParser = getApplication().getMarkupSettings()
          .getMarkupFactory()
          .newMarkupParser(markupResourceStream);
        pageMarkup = markupParser.parse();
      }
      catch (Exception e)
      {
        fail("Error while parsing the markup for the autogenerated page: " + e.getMessage());
      }
View Full Code Here

  private static boolean compareMarkup(final String a, final String b)
  {
    try
    {
      // Parse a and b into markup and compare
      final MarkupStream amarkup = new MarkupStream(new MarkupParser(a).parse());
      final MarkupStream bmarkup = new MarkupStream(new MarkupParser(b).parse());
      return amarkup.equalTo(bmarkup);
    }
    catch (IOException e)
    {
      e.printStackTrace();
View Full Code Here

        {
          // now parse the velocity merge result
          Markup markup;
          try
          {
            MarkupParser parser = getApplication().getMarkupSettings()
                .getMarkupParserFactory().newMarkupParser(
                    new MarkupResourceStream(
                        new StringResourceStream(result)));
            markup = parser.parse();
          }
          catch (ResourceStreamNotFoundException e)
          {
            throw new RuntimeException("Could not parse resulting markup", e);
          }
View Full Code Here

public class SpringMarkupFactory extends MarkupFactory {
    private BeansRegistry<IMarkupFilter> markupFiltersRegistry;
   
    @Override
    public MarkupParser newMarkupParser(MarkupResourceStream resource) {
        MarkupParser parser = super.newMarkupParser(resource);
        final Collection<IMarkupFilter> markupFilters = getMarkupFilters();
        if(markupFilters != null) {
            for(IMarkupFilter filter : markupFilters) {
                parser.add(filter);
            }
        }
        return parser;
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.MarkupParser

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.