Examples of ObjectCreateRule


Examples of org.apache.commons.digester.ObjectCreateRule

    protected class ObjectCreateRuleFactory extends AbstractObjectCreationFactory {
        public Object createObject(Attributes attributes) {
            String className = attributes.getValue("classname");
            String attrName = attributes.getValue("attrname");
            return (attrName == null || attrName.length() == 0) ?
                new ObjectCreateRule( className)
                :
                new ObjectCreateRule( className, attrName);
        }
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

            }
        });
        digester.setValidating(true);

        // dictionary rules
        digester.addRule("*/key", new ObjectCreateRule(PListNode.class)
        {
            public void end() throws Exception
            {
                // leave the node on the stack to set the value
            }
        });

        digester.addCallMethod("*/key", "setName", 0);

        digester.addRule("*/dict/string", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/data", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/integer", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/real", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/true", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/false", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/date", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/dict", new SetNextAndPopRule("addChild"));

        digester.addCallMethod("*/dict/string", "addValue", 0);
        digester.addCallMethod("*/dict/data", "addDataValue", 0);
        digester.addCallMethod("*/dict/integer", "addIntegerValue", 0);
        digester.addCallMethod("*/dict/real", "addRealValue", 0);
        digester.addCallMethod("*/dict/true", "addTrueValue");
        digester.addCallMethod("*/dict/false", "addFalseValue");
        digester.addCallMethod("*/dict/date", "addDateValue", 0);

        // rules for arrays
        digester.addRule("*/dict/array", new SetNextAndPopRule("addChild"));
        digester.addRule("*/dict/array", new ObjectCreateRule(ArrayNode.class));
        digester.addSetNext("*/dict/array", "addList");

        digester.addRule("*/array/array", new ObjectCreateRule(ArrayNode.class));
        digester.addSetNext("*/array/array", "addList");

        digester.addCallMethod("*/array/string", "addValue", 0);
        digester.addCallMethod("*/array/data", "addDataValue", 0);
        digester.addCallMethod("*/array/integer", "addIntegerValue", 0);
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

        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);
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

     *               state on the Digester stack
     */
    private static void addStateRules(final String xp,
            final ExtendedBaseRules scxmlRules, final List customActions,
            final SCXML scxml, final PathResolver pr, final int parent) {
        scxmlRules.add(xp, new ObjectCreateRule(State.class));
        addStatePropertiesRules(xp, scxmlRules, customActions, pr, scxml);
        addDatamodelRules(xp + XPF_DM, scxmlRules, scxml, pr);
        addInvokeRules(xp + XPF_INV, scxmlRules, customActions, pr, scxml);
        addInitialRules(xp + XPF_INI, scxmlRules, customActions, pr, scxml);
        addHistoryRules(xp + XPF_HIST, scxmlRules, customActions, pr, scxml);
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

     * @param scxml The parent SCXML document (or null)
     */
    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));
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

     * @param scxml The parent SCXML document (or null)
     */
    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);
        scxmlRules.add(xp + XPF_FIN, new SetNextRule("setFinalize"));
        scxmlRules.add(xp, new SetNextRule("setInvoke"));
    }
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

     * @param scxml The parent SCXML document (or null)
     */
    private static void addInitialRules(final String xp,
            final ExtendedBaseRules scxmlRules, final List customActions,
            final PathResolver pr, final SCXML scxml) {
        scxmlRules.add(xp, new ObjectCreateRule(Initial.class));
        addPseudoStatePropertiesRules(xp, scxmlRules, customActions, pr,
            scxml);
        scxmlRules.add(xp, new UpdateModelRule(scxml));
        addTransitionRules(xp + XPF_TR, scxmlRules, "setTransition",
            pr, customActions);
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

     * @param scxml The parent SCXML document (or null)
     */
    private static void addHistoryRules(final String xp,
            final ExtendedBaseRules scxmlRules, final List customActions,
            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"}));
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

     *                      to be able to process
     */
    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());
        scxmlRules.add(xp + XPF_TAR, new SetPropertiesRule());
View Full Code Here

Examples of org.apache.commons.digester.ObjectCreateRule

     *                      to be able to process
     */
    private static void addHandlerRules(final String xp,
            final ExtendedBaseRules scxmlRules, final PathResolver pr,
            final List customActions) {
        scxmlRules.add(xp + XPF_ONEN, new ObjectCreateRule(OnEntry.class));
        addActionRules(xp + XPF_ONEN, scxmlRules, pr, customActions);
        scxmlRules.add(xp + XPF_ONEN, new SetNextRule("setOnEntry"));
        scxmlRules.add(xp + XPF_ONEX, new ObjectCreateRule(OnExit.class));
        addActionRules(xp + XPF_ONEX, scxmlRules, pr, customActions);
        scxmlRules.add(xp + XPF_ONEX, new SetNextRule("setOnExit"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.