Package cambridge.model

Examples of cambridge.model.SimpleAttribute


        this.expression = expression;
    }

    public void modify(Map<String, Object> bindings, ModifyableTag tag) throws ExpressionEvaluationException {
        if (expression.asBoolean(bindings)) {
            tag.getTagParts().add(new SimpleAttribute("selected", "selected", getLine(), getCol()));
        }
    }
View Full Code Here


                                 break;
                           }
                        }

                        if (fragments.size() == 0 || fragments.size() == 1 && fragments.get(0) instanceof StaticFragment) {
                           element = new SimpleAttribute(currentToken.getLineNo(), currentToken.getColumn());
                           ((SimpleAttribute) element).setValue(currentToken.value);
                        } else {
                           element = new ComplexAttribute(currentToken.getLineNo(), currentToken.getColumn());
                           ((ComplexAttribute) element).setFragments(fragments);
                           AttributeValueToken aTok = (AttributeValueToken) currentToken;
View Full Code Here

    public void modify(TemplateDocument doc, String value, TagNode t) {
        ArrayList<Tag> tags = t.getElementsByTagName("img");
        for (Tag tag : tags) {
            if (!tag.hasAttribute("alt")) {
                tag.addAttribute(new SimpleAttribute("alt", "", line, col));
            }
        }
        if (t.getTagName().equalsIgnoreCase("img")) {
            if (!t.hasAttribute("alt")) {
                t.addAttribute(new SimpleAttribute("alt", "", line, col));
            }
        }
    }
View Full Code Here

                                            break;
                                    }
                                }

                                if (fragments.size() == 0 || fragments.size() == 1 && fragments.get(0) instanceof StaticFragment) {
                                    element = new SimpleAttribute(currentToken.getLineNo(), currentToken.getColumn());
                                    ((SimpleAttribute) element).setValue(currentToken.value);
                                } else {
                                    element = new ComplexAttribute(currentToken.getLineNo(), currentToken.getColumn());
                                    ((ComplexAttribute) element).setFragments(fragments);
                                    AttributeValueToken aTok = (AttributeValueToken) currentToken;
                                    if (aTok.getQuotes() == -2) {
                                        ((ComplexAttribute) element).setQuote('"');
                                    } else if (aTok.getQuotes() == -3) {
                                        ((ComplexAttribute) element).setQuote('\'');
                                    }
                                }

                                exitLoop = true;
                                break;
                        }

                        if (exitLoop) break;
                    }

                    if (element == null) {
                        if (tok != null) {
                            element = new SimpleAttribute(tok.getAttributeName(), tok.getNameSpace(), tok.getLineNo(), tok.getLineNo());
                        } else {
                            throw new TemplateParsingException("Error parsing template file. Unterminated tag?", currentToken.getLineNo(), currentToken.getColumn());
                        }
                    }
View Full Code Here

    public void modify(TemplateDocument doc, String value, TagNode t) {
        ArrayList<Tag> tags = t.getElementsByTagName("img");
        for (Tag tag : tags) {
            if (!tag.hasAttribute("alt")) {
                tag.addAttribute(new SimpleAttribute("alt", "", line, col));
            }
        }
        if (t.getTagName().equalsIgnoreCase("img")) {
            if (!t.hasAttribute("alt")) {
                t.addAttribute(new SimpleAttribute("alt", "", line, col));
            }
        }
    }
View Full Code Here

        this.expression = expression;
    }

    public void modify(ExpressionContext context, ModifyableTag tag) throws ExpressionEvaluationException {
        if (expression.asBoolean(context)) {
            tag.getTagParts().add(new SimpleAttribute("selected", "selected", getLine(), getCol()));
        }
    }
View Full Code Here

TOP

Related Classes of cambridge.model.SimpleAttribute

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.