Package org.apache.commons.digester

Examples of org.apache.commons.digester.Rule


        scxmlRules.add(xp, new SetCurrentNamespacesRule());
        addActionRules(xp, scxmlRules, pr, customActions);

        // Add <exit> custom action rule in Commons SCXML namespace
        scxmlRules.setNamespaceURI(NAMESPACE_COMMONS_SCXML);
        scxmlRules.add(xp + XPF_EXT, new Rule() {
            public void end(final String namespace, final String name) {
                Transition t = (Transition) getDigester().peek(1);
                TransitionTarget tt = (TransitionTarget) getDigester().
                    peek(2);
                if (tt instanceof Initial) {
View Full Code Here


    // resource <f:resource f:key='images/spacer.gif' [f:data='...'] [ ... any attributes ... ] />
    pattern =ANY_PARENT+NS_PREFIX+RESOURCE_TAG;
    digestr.addObjectCreate(pattern,ResourceElement.class);
    digestr.addSetNext(pattern,CHILD_METHOD);
    {
    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);
View Full Code Here

    private static void addParentRule(final String xp,
            final ExtendedBaseRules scxmlRules, final int parent) {
        if (parent < 1) {
            return;
        }
        scxmlRules.add(xp, new Rule() {
            // A generic version of setTopRule
            public void body(final String namespace, final String name,
                    final String text) throws Exception {
                TransitionTarget t = (TransitionTarget) getDigester().peek();
                TransitionTarget p = (TransitionTarget) getDigester().peek(
View Full Code Here

            new String[] {"event", "cond", "target"},
            new String[] {"event", "cond", "next"}));
        scxmlRules.add(xp, new SetCurrentNamespacesRule());
        scxmlRules.add(xp + XPF_TAR, new SetPropertiesRule());
        addActionRules(xp, scxmlRules, pr, customActions);
        scxmlRules.add(xp + XPF_EXT, new Rule() {
            public void end(final String namespace, final String name) {
                Transition t = (Transition) getDigester().peek(1);
                State exitState = new State();
                exitState.setIsFinal(true);
                t.setTarget(exitState);
View Full Code Here

    Digester digester = new Digester();
    digester.clear();
    digester.setNamespaceAware(false);
        digester.setUseContextClassLoader(false);
        digester.setValidating(false);
        digester.addRule("map/entry", new Rule() {
          /** SCXML target ID. */
          private String targetId;
          /** JSF view ID. */
          private String viewId;
            /** {@inheritDoc} */
 
View Full Code Here

                }
                digester.push(model);
            }
        });
        */
        digester.addRule(path, new Rule() {
            @Override
            public void begin(String string, String string1, Attributes attributes) throws Exception {
                UMOModel model = MuleManager.getInstance().getModel();
                if (model == null) {
                    model = new MuleModel();
View Full Code Here

                }
                digester.push(model);
            }
        });
        */
        digester.addRule(path, new Rule() {
            @Override
            public void begin(String string, String string1, Attributes attributes) throws Exception {
                UMOModel model = MuleManager.getInstance().getModel();
                if (model == null) {
                    model = new MuleModel();
View Full Code Here

    }


    protected void addJbiContainerRules(Digester digester, String path) throws ConfigurationException {
        digester.addObjectCreate(path, JbiContainerImpl.class.getName());
        digester.addRule(path, new Rule(){
            public void begin(String s, String s1, Attributes attributes) throws Exception {
                ((JbiContainer)digester.getRoot()).initialize();
            }
        });
    }
View Full Code Here

        // Create Message Routers
        addMessageRouterRules(digester, path, "inbound");
        addMessageRouterRules(digester, path, "outbound");
        addMessageRouterRules(digester, path, "response");

        digester.addRule(path, new Rule(){
            public void end(String s, String s1) throws Exception {
                AbstractComponent c = (AbstractComponent)digester.peek();
                JbiContainer cont = ((JbiContainer)digester.getRoot());
                c.setContainer(cont);
                cont.getRegistry().addTransientComponent(c.getName(), ComponentType.JBI_ENGINE_COMPONENT, c, c.getBootstrap());
View Full Code Here

    public List match(String namespaceURI, String pattern) {
        List list    = rules.match(namespaceURI, pattern);
        List sublist = new ArrayList(list.size());

        for (Iterator i = list.iterator(); i.hasNext();) {
            Rule rule = (Rule) i.next();

            if (!(rule instanceof ContextSensitiveRule)
                        || ((ContextSensitiveRule) rule).isContextMatched(context)) {
                sublist.add(rule);
            }
View Full Code Here

TOP

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

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.