org.kuali.rice.kew.xml
Class RuleTemplateXmlParser

java.lang.Object
  extended by org.kuali.rice.kew.xml.RuleTemplateXmlParser

public class RuleTemplateXmlParser
extends Object

Parses RuleTemplateBos from XML.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
RuleTemplateBo

Constructor Summary
RuleTemplateXmlParser()
           
 
Method Summary
 Timestamp formatDate(String dateLabel, String dateString)
           
 List<RuleTemplateBo> parseRuleTemplates(org.jdom.Element element)
           
 List<RuleTemplateBo> parseRuleTemplates(InputStream input)
           
protected  void updateDelegationTemplate(org.jdom.Element ruleTemplateElement, RuleTemplateBo updatedRuleTemplate, List<RuleTemplateBo> parsedRuleTemplates)
          Updates the rule template delegation template with the one specified in the XML (if any)
protected  void updateOrDeleteRuleTemplateOption(RuleTemplateBo updatedRuleTemplate, String key, Object value)
          Updates or deletes a specified rule template option on the rule template
protected  boolean updateRuleDefaults(org.jdom.Element defaultsElement, RuleTemplateBo updatedRuleTemplate)
          Updates the default/template rule options with those in the defaults element
protected  void updateRuleTemplateAttributes(org.jdom.Element ruleTemplateElement, RuleTemplateBo updatedRuleTemplate)
          Updates the attributes set on the RuleTemplate
protected  void updateRuleTemplateDefaultOptions(org.jdom.Element ruleTemplateElement, RuleTemplateBo updatedRuleTemplate)
          Updates the rule template default options.
protected  void updateRuleTemplateOptions(org.jdom.Element defaultsElement, RuleTemplateBo updatedRuleTemplate, boolean isDelegation)
          Updates the rule template defaults options with those in the defaults element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleTemplateXmlParser

public RuleTemplateXmlParser()
Method Detail

parseRuleTemplates

public List<RuleTemplateBo> parseRuleTemplates(InputStream input)
                                        throws IOException,
                                               XmlException
Throws:
IOException
XmlException

parseRuleTemplates

public List<RuleTemplateBo> parseRuleTemplates(org.jdom.Element element)
                                        throws XmlException
Throws:
XmlException

updateRuleTemplateDefaultOptions

protected void updateRuleTemplateDefaultOptions(org.jdom.Element ruleTemplateElement,
                                                RuleTemplateBo updatedRuleTemplate)
                                         throws XmlException
Updates the rule template default options. Updates any existing options, removes any omitted ones.

Parameters:
ruleTemplateElement - the rule template XML element
updatedRuleTemplate - the RuleTemplate being updated
Throws:
XmlException

updateRuleTemplateOptions

protected void updateRuleTemplateOptions(org.jdom.Element defaultsElement,
                                         RuleTemplateBo updatedRuleTemplate,
                                         boolean isDelegation)
                                  throws XmlException
Updates the rule template defaults options with those in the defaults element

Parameters:
defaultsElement - the ruleDefaults element
updatedRuleTemplate - the Rule Template being updated
Throws:
XmlException

updateRuleDefaults

protected boolean updateRuleDefaults(org.jdom.Element defaultsElement,
                                     RuleTemplateBo updatedRuleTemplate)
                              throws XmlException
Updates the default/template rule options with those in the defaults element

Parameters:
defaultsElement - the ruleDefaults element
updatedRuleTemplate - the Rule Template being updated
Returns:
whether this is a delegation rule template
Throws:
XmlException

updateOrDeleteRuleTemplateOption

protected void updateOrDeleteRuleTemplateOption(RuleTemplateBo updatedRuleTemplate,
                                                String key,
                                                Object value)
Updates or deletes a specified rule template option on the rule template

Parameters:
updatedRuleTemplate - the RuleTemplate being updated
key - the option key
value - the option value

updateDelegationTemplate

protected void updateDelegationTemplate(org.jdom.Element ruleTemplateElement,
                                        RuleTemplateBo updatedRuleTemplate,
                                        List<RuleTemplateBo> parsedRuleTemplates)
                                 throws XmlException
Updates the rule template delegation template with the one specified in the XML (if any)

Parameters:
ruleTemplateElement - the XML ruleTemplate element
updatedRuleTemplate - the rule template to update
parsedRuleTemplates - the rule templates parsed in this parsing run
Throws:
XmlException - if a delegation template was specified but could not be found

updateRuleTemplateAttributes

protected void updateRuleTemplateAttributes(org.jdom.Element ruleTemplateElement,
                                            RuleTemplateBo updatedRuleTemplate)
                                     throws XmlException
Updates the attributes set on the RuleTemplate

Parameters:
ruleTemplateElement - the XML ruleTemplate element
updatedRuleTemplate - the RuleTemplate being updated
Throws:
XmlException - if there was a problem parsing the rule template attributes

formatDate

public Timestamp formatDate(String dateLabel,
                            String dateString)
                     throws XmlException
Throws:
XmlException


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.