org.cogroo.tools.checker.rules.applier
Class RulesXmlAccess

java.lang.Object
  extended by org.cogroo.tools.checker.rules.applier.RulesXmlAccess
All Implemented Interfaces:
RulesAccess

public class RulesXmlAccess
extends Object
implements RulesAccess

Class that provides access to the rules read from a xml file.


Method Summary
static RulesAccess getInstance()
           
static RulesAccess getInstance(String serializedRule)
           
 Rule getRule(int id)
          Gets a rule by its id.
 Rules getRules()
           
 void persist(Rules newRules)
           
 void validate()
          Checks the xml against the xsd.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static RulesAccess getInstance()

getInstance

public static RulesAccess getInstance(String serializedRule)

validate

public void validate()
Checks the xml against the xsd.


getRule

public Rule getRule(int id)
Gets a rule by its id.

Parameters:
id - the id of the rule
rereadRules - states if the rules must be read from the file or to reuse the in-memory representation, if it already exists
Returns:
the rule

getRules

public Rules getRules()
Specified by:
getRules in interface RulesAccess

persist

public void persist(Rules newRules)
Specified by:
persist in interface RulesAccess


Copyright © 2012-2013 CoGrOO. All Rights Reserved.