org.anadix.swingparser
Class SwingParser

java.lang.Object
  extended by org.anadix.swingparser.SwingParser
All Implemented Interfaces:
Parser

public class SwingParser
extends Object
implements Parser

Parser implementation based on parser from package javax.swing.text.html.parser. Uses set of rules to recognize different tags and HTMLElementFactory to insert those tags into working memory. Rules are created from a template (rule-template.drt) and different tag names are stored in tags.csv. There are also some common rules (swingparser.drl) to manipulate tags position and source.

Version:
$Id: $
Author:
tomason

Constructor Summary
SwingParser()
          Constructor
 
Method Summary
 Collection<DroolsResource> getDroolsResources()
          Returns resources (typically DRL files) used by Drools engine to process parser output.
 Class<? extends ElementFactory> getElementFactoryClass()
          Returns class implementing ElementFactory that is used to insert elements into Drools working memory
 void parse(ElementFactory factory, Source source)
          Parses given source and inserts Elements through ElementFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingParser

public SwingParser()
Constructor

Method Detail

parse

public void parse(ElementFactory factory,
                  Source source)
           throws ParserException
Parses given source and inserts Elements through ElementFactory

Specified by:
parse in interface Parser
Parameters:
factory - - ElementFactory to be used
source - - source to parse
Throws:
ParserException - - when something goes wrong during parsing

getDroolsResources

public Collection<DroolsResource> getDroolsResources()
Returns resources (typically DRL files) used by Drools engine to process parser output. If no such resources are used this method returns empty collection

Specified by:
getDroolsResources in interface Parser
Returns:
collection of DroolsResources

getElementFactoryClass

public Class<? extends ElementFactory> getElementFactoryClass()
Returns class implementing ElementFactory that is used to insert elements into Drools working memory

Specified by:
getElementFactoryClass in interface Parser
Returns:
instance of Class


Copyright © 2011. All Rights Reserved.