Package org.apache.commons.digester

Examples of org.apache.commons.digester.SetPropertiesRule


     * @param scxml The root document, if this one is src'ed in
     */
    private static void addStatePropertiesRules(final String xp,
            final ExtendedBaseRules scxmlRules, final List customActions,
            final PathResolver pr, final SCXML scxml) {
        scxmlRules.add(xp, new SetPropertiesRule(
                new String[] {"id", "final", "initial"},
                new String[] {"id", "final", "first"}));
        scxmlRules.add(xp, new DigestSrcAttributeRule(scxml,
            customActions, pr));
    }
View Full Code Here


    private static void addDatamodelRules(final String xp,
            final ExtendedBaseRules scxmlRules, final SCXML scxml,
            final PathResolver pr) {
        scxmlRules.add(xp, new ObjectCreateRule(Datamodel.class));
        scxmlRules.add(xp + XPF_DATA, new ObjectCreateRule(Data.class));
        scxmlRules.add(xp + XPF_DATA, new SetPropertiesRule());
        scxmlRules.add(xp + XPF_DATA, new SetCurrentNamespacesRule());
        scxmlRules.add(xp + XPF_DATA, new SetNextRule("addData"));
        try {
            scxmlRules.add(xp + XPF_DATA, new ParseDataRule(pr));
        } catch (ParserConfigurationException pce) {
View Full Code Here

     */
    private static void addInvokeRules(final String xp,
            final ExtendedBaseRules scxmlRules, final List customActions,
            final PathResolver pr, final SCXML scxml) {
        scxmlRules.add(xp, new ObjectCreateRule(Invoke.class));
        scxmlRules.add(xp, new SetPropertiesRule());
        scxmlRules.add(xp, new SetCurrentNamespacesRule());
        scxmlRules.add(xp, new SetPathResolverRule(pr));
        scxmlRules.add(xp + XPF_PRM, new ObjectCreateRule(Param.class));
        scxmlRules.add(xp + XPF_PRM, new SetPropertiesRule());
        scxmlRules.add(xp + XPF_PRM, new SetCurrentNamespacesRule());
        scxmlRules.add(xp + XPF_PRM, new SetNextRule("addParam"));
        scxmlRules.add(xp + XPF_FIN, new ObjectCreateRule(Finalize.class));
        scxmlRules.add(xp + XPF_FIN, new UpdateFinalizeRule());
        addActionRules(xp + XPF_FIN, scxmlRules, pr, customActions);
View Full Code Here

            final PathResolver pr, final SCXML scxml) {
        scxmlRules.add(xp, new ObjectCreateRule(History.class));
        addPseudoStatePropertiesRules(xp, scxmlRules, customActions, pr,
            scxml);
        scxmlRules.add(xp, new UpdateModelRule(scxml));
        scxmlRules.add(xp, new SetPropertiesRule(new String[] {"type"},
            new String[] {"type"}));
        addTransitionRules(xp + XPF_TR, scxmlRules, "setTransition",
            pr, customActions);
        scxmlRules.add(xp, new SetNextRule("addHistory"));
    }
View Full Code Here

     * @param scxml The root document, if this one is src'ed in
     */
    private static void addPseudoStatePropertiesRules(final String xp,
            final ExtendedBaseRules scxmlRules, final List customActions,
            final PathResolver pr, final SCXML scxml) {
        scxmlRules.add(xp, new SetPropertiesRule(new String[] {"id"},
            new String[] {"id"}));
        scxmlRules.add(xp, new DigestSrcAttributeRule(scxml, customActions,
            pr));
    }
View Full Code Here

     */
    private static void addTransitionRules(final String xp,
            final ExtendedBaseRules scxmlRules, final String setNextMethod,
            final PathResolver pr, final List customActions) {
        scxmlRules.add(xp, new ObjectCreateRule(Transition.class));
        scxmlRules.add(xp, new SetPropertiesRule(
            new String[] {"event", "cond", "target"},
            new String[] {"event", "cond", "next"}));
        scxmlRules.add(xp, new SetCurrentNamespacesRule());
        addActionRules(xp, scxmlRules, pr, customActions);

View Full Code Here

            final ExtendedBaseRules scxmlRules, final Class klass,
            final String[] args, final String[] props,
            final String addMethod) {
        scxmlRules.add(xp, new ObjectCreateRule(klass));
        if (args == null) {
            scxmlRules.add(xp, new SetPropertiesRule());
        } else {
            scxmlRules.add(xp, new SetPropertiesRule(args, props));
        }
        scxmlRules.add(xp, new SetNextRule(addMethod));
    }
View Full Code Here

    {
    Rule rule = new PutAttributesRule(digestr,new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"baseSkin",NS_PREFIX+"skin",NS_PREFIX+"context"});
    digestr.addRule(pattern,rule);
    }
    {
    SetPropertiesRule rule = new SetPropertiesRule(new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"baseSkin",NS_PREFIX+"skin",NS_PREFIX+"context"},new String[]{"value","property","baseSkin","skin","context"});   
    digestr.addRule(pattern,rule);
    }
    // custom attribute <f:attribute name='style' (value='....' | property='style' | skin='paramName' | call='methodName' | utilCall='methodName') [notNull='true'] />
    pattern = ANY_PARENT+NS_PREFIX+ATTRIBUTE_TAG;
    digestr.addObjectCreate(pattern,AttributeElement.class);
    digestr.addSetNext(pattern,CHILD_METHOD);
    digestr.addSetProperties(pattern);
    // component clientId <f:id [f:required='true'] />
    // breakpoint <f:break name="name">
    pattern = ANY_PARENT+NS_PREFIX+BREAK_TAG;
    digestr.addObjectCreate(pattern,BreakPoint.class);
    digestr.addSetProperties(pattern);
    digestr.addSetNext(pattern,CHILD_METHOD);
    // conditional rendering  <f:if then="true">
    pattern = ANY_PARENT+NS_PREFIX+IF_TAG;
    digestr.addObjectCreate(pattern,IfElement.class);
    digestr.addSetProperties(pattern);
    digestr.addSetNext(pattern,CHILD_METHOD);
    // facet <u:insertFacet name="name">
    pattern = ANY_PARENT+NS_UTIL_PREFIX+FACET_TAG;
    digestr.addObjectCreate(pattern,FacetElement.class);
    digestr.addSetProperties(pattern);
    digestr.addSetNext(pattern,CHILD_METHOD);
   
    // childrens <u:insertChildren>
    pattern = ANY_PARENT+NS_UTIL_PREFIX+CHILDREN_TAG;
    digestr.addObjectCreate(pattern,ChildrensElement.class);
    digestr.addSetNext(pattern,CHILD_METHOD);
//    {
//      Rule rule = new PutAttributesRule(digestr,new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"skin",NS_PREFIX+"context"});
//      digestr.addRule(pattern,rule);
//      }
      {
      SetPropertiesRule rule = new SetPropertiesRule(new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"skin",NS_PREFIX+"context"},new String[]{"value","property","skin","context"});   
      digestr.addRule(pattern,rule);
      }


   
View Full Code Here

public class DigesterSetPropertiesRuleDef extends AbstractDigesterRuleDefImpl {
    public static final String RCS_ID = "$Id: DigesterSetPropertiesRuleDef.java 17 2006-10-19 15:11:35Z maldito_orco $";
    private static Log log = LogFactory.getLog(DigesterSetPropertiesRuleDef.class);

    public Rule getDigesterRule() {
        SetPropertiesRule rule = new SetPropertiesRule();
        return rule;
    }
View Full Code Here

        ExtendedBaseRules scxmlRules = new ExtendedBaseRules();
        scxmlRules.setNamespaceURI(NAMESPACE_SCXML);

        //// SCXML
        scxmlRules.add(XP_SM, new ObjectCreateRule(SCXML.class));
        scxmlRules.add(XP_SM, new SetPropertiesRule());

        //// Datamodel at document root i.e. <scxml> datamodel
        addDatamodelRules(XP_SM + XPF_DM, scxmlRules, scxml, pr);

        //// States
View Full Code Here

TOP

Related Classes of org.apache.commons.digester.SetPropertiesRule

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.