Package org.apache.shale.clay.parser

Examples of org.apache.shale.clay.parser.Node


     */
    public boolean execute(Context context) throws Exception {
        boolean isFinal = false;

        BuilderRuleContext builderRuleContext = (BuilderRuleContext) context;
        Node node = builderRuleContext.getNode();
        if (!node.isComment() && node.getName() != null
            && node.getName().equalsIgnoreCase("label")) {

            builderRuleContext.setBuilder(BUILDER);
            isFinal = true;
        }

View Full Code Here


    public boolean execute(Context context) throws Exception {

        boolean isFinal = false;

        BuilderRuleContext builderRuleContext = (BuilderRuleContext) context;
        Node node = builderRuleContext.getNode();
        if (!node.isComment() && node.getName() != null
             && node.getName().equalsIgnoreCase("input")) {

            String type = (String) node.getAttributes().get("type");
            if (type != null && type.equalsIgnoreCase("text")) {
                builderRuleContext.setBuilder(BUILDERS[0]);
                isFinal = true;
            } else if (type != null && type.equalsIgnoreCase("checkbox")) {
                builderRuleContext.setBuilder(BUILDERS[1]);
View Full Code Here

     */
    public boolean execute(Context context) throws Exception {


        BuilderRuleContext builderRuleContext = (BuilderRuleContext) context;
        Node node = builderRuleContext.getNode();
        if (node.isComment() || node.isCdata()) {
            builderRuleContext.setBuilder(BUILDERS[0]);
        } else  if (node.getName() != null && node.getAttributes().containsKey("jsfid")) {
            builderRuleContext.setBuilder(BUILDERS[1]);
        } else {
            builderRuleContext.setBuilder(BUILDERS[2]);
        }

View Full Code Here

     * @param target child config bean
     */
    protected void addValidatorVar(Node attributesNode, ComponentBean target) {
        Iterator ci = attributesNode.getChildren().iterator();
        while (ci.hasNext()) {
            Node child = (Node) ci.next();
            if (child.isWellFormed() && child.getName() != null
                && child.getName().equals("validatorVar")) {

                String name = (String) child.getAttributes().get("name");
                String value = (String) child.getAttributes().get("value");
                String bindingType = (String) child.getAttributes().get("bindingType");

                AttributeBean attr = target.getAttribute(name);
                if (attr != null) {
                    createAttribute(attr, value, target);
                } else {
View Full Code Here

     */
    public boolean execute(Context context) throws Exception {
        boolean isFinal = false;

        BuilderRuleContext builderRuleContext = (BuilderRuleContext) context;
        Node node = builderRuleContext.getNode();
        if (!node.isComment() && node.getName() != null
            && node.getName().equalsIgnoreCase("option")) {

            if (node.getChildren().size() > 0) {
                builderRuleContext.setBuilder(BUILDERS[0]);
                isFinal = true;
            } else {
                // no value attribute, must be bound to a component
                builderRuleContext.setBuilder(BUILDERS[1]);
View Full Code Here

        String facetName = (String) node.getAttributes().get("name");
        Iterator ci = node.getChildren().iterator();
        // look for the first well-formed node.  only one under
        // a facet.  Call back on the current builder
        while (ci.hasNext()) {
            Node child = (Node) ci.next();
            if (child.isWellFormed()) {
                Builder childBuilder = getBuilder(child);
                ElementBean nextTarget = childBuilder.createElement(child);
                nextTarget.setFacetName(facetName);
                target.addChild(nextTarget);
                childBuilder.encode(child, nextTarget, nextTarget);
View Full Code Here

        assignNode(node, target);

        List deleteList = new ArrayList();
        Iterator ci = node.getChildren().iterator();
        next: while (ci.hasNext()) {
            Node child = (Node) ci.next();
            if (child.isWellFormed() && child.getName() != null) {
                if (child.getName().equals("symbol")) {
                    addSymbol(child, target);
                    deleteList.add(child);
                } else if (child.getName().equals("facet")) {
                    addFacet(child, target);
                    deleteList.add(child);
                } else if (child.getName().equals("attribute")) {
                    addAttribute(child, target);
                    deleteList.add(child);
                } else if (child.getName().startsWith("convert")) {
                    addConverter(child, target);
                    deleteList.add(child);
                } else if (child.getName().startsWith("validate")
                        || child.getName().startsWith("validator")
                        || child.getName().startsWith("commonsValidator")) {
                    addValidator(child, target);
                    deleteList.add(child);
                } else if (child.getName().equals("actionListener")) {
                    addActionListener(child, target);
                    deleteList.add(child);
                } else if (child.getName().equals("valueChangeListener")) {
                    addValueChangeListener(child, target);
                    deleteList.add(child);
                }
            } else {
                if (node.getName() != null && node.getName().equals("verbatim")) {
                    continue next;
                }
                if (child.isComment() || isNodeWhitespace(child)) {
                    // remove white space
                    deleteList.add(child);
                }
            }
        }
View Full Code Here

    public boolean execute(Context context) throws Exception {

        boolean isFinal = false;

        BuilderRuleContext builderRuleContext = (BuilderRuleContext) context;
        Node node = builderRuleContext.getNode();
        if (!node.isComment() && node.getName() != null
            && node.getName().equalsIgnoreCase("a")) {
            builderRuleContext.setBuilder(BUILDER);
            isFinal = true;

        }
View Full Code Here

     */
    public boolean execute(Context context) throws Exception {
        boolean isFinal = false;

        BuilderRuleContext builderRuleContext = (BuilderRuleContext) context;
        Node node = builderRuleContext.getNode();
        if (!node.isComment() && node.getName() != null
            && node.getName().equals("span")
            && node.getAttributes().containsKey("jsfid")) {

            builderRuleContext.setBuilder(BUILDER);
            isFinal = true;
        }

View Full Code Here

        //remove any children that are not option nodes
        ArrayList delList = new ArrayList();
        Iterator ci = node.getChildren().iterator();
        while (ci.hasNext()) {
           Node child = (Node) ci.next();
           if (child.getName() == null || !child.getName().equalsIgnoreCase("option")) {
              delList.add(child);
           }
        }
        for (int i = 0; i < delList.size(); i++) {
           node.getChildren().remove(delList.get(i));
View Full Code Here

TOP

Related Classes of org.apache.shale.clay.parser.Node

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.