Package org.brixcms.markup.tag

Examples of org.brixcms.markup.tag.Tag


    private List<Item> filter(List<Item> items) {
        List<Item> result = new ArrayList<Item>();

        for (Item i : items) {
            if (i instanceof Tag) {
                Tag tag = (Tag) i;
                if (shouldFilter(tag.getName())) {
                    continue;
                }
            }
            result.add(i);
        }
View Full Code Here


        int skipLevel = 0;

        for (Item i : originalItems) {
            if (skipLevel > 0) {
                if (i instanceof Tag) {
                    Tag tag = (Tag) i;
                    if (tag.getType() == Tag.Type.OPEN) {
                        ++skipLevel;
                    } else if (tag.getType() == Tag.Type.CLOSE) {
                        --skipLevel;
                    }
                }
                continue;
            }

            if (i instanceof Tag) {
                Tag tag = (Tag) i;
                if (TAG_NAME.equals(tag.getName())) {
                    result.add(new TitleText(container));

                    if (tag.getType() == Tag.Type.OPEN) {
                        ++skipLevel;
                    }

                    continue;
                }
View Full Code Here

        int headDepth = 0;

        for (Item i : items) {
            if (i instanceof Tag) {
                Tag tag = (Tag) i;
                if (isHead(tag)) {
                    if (tag.getType() == Tag.Type.OPEN) {
                        ++headDepth;
                    } else if (tag.getType() == Tag.Type.CLOSE) {
                        if (headDepth > 0) {
                            --headDepth;
                        }
                    }
                    continue;
View Full Code Here

        int headDepth = 0;
        int bodyDepth = 0;

        for (Item i : originalItems) {
            if (i instanceof Tag) {
                Tag tag = (Tag) i;

                if (wasHead == false && (isHead(tag) || "body".equals(tag.getName()))) {
                    Map<String, String> emptyMap = Collections.emptyMap();
                    result.add(new SimpleTag("head", Tag.Type.OPEN, emptyMap));
                    result.addAll(headContent);
                    result.add(new SimpleTag("head", Tag.Type.CLOSE, null));
                    if ("body".equals(tag.getName())) {
                        bodyDepth++;
                        result.add(tag);
                    }
                    wasHead = true;
                    if (isHead(tag) && (tag.getType() == Tag.Type.OPEN)) {
                        ++headDepth;
                    }
                    continue;
                }

                if ("body".equals(tag.getName())) {
                    if (tag.getType() == Tag.Type.OPEN) {
                        if (bodyDepth == 0) {
                            result.add(tag);
                        }
                        ++bodyDepth;
                    } else if (tag.getType() == Tag.Type.CLOSE) {
                        --bodyDepth;
                        if (bodyDepth == 0) {
                            result.add(tag);
                        }
                    }
                    continue;
                }

                if (isHead(tag)) {
                    if (tag.getType() == Tag.Type.OPEN) {
                        ++headDepth;
                    } else if (tag.getType() == Tag.Type.CLOSE) {
                        if (headDepth > 0) {
                            --headDepth;
                        }
                    }
                    continue;
View Full Code Here

        return Application.get().getMapperContext().getNamespace() + ":id";
    }

    @Override
    protected List<Item> transform(List<Item> items) {
        Tag enclosure = null;
        List<String> children = null;
        List<Tag> enclosureChildTags = null;
        for (Item i : items) {
            if (i instanceof Tag) {
                Tag tag = (Tag) i;
                if (isEnclosure(tag)) {
                    if (tag.getType() == Tag.Type.OPEN) {
                        // found opening enclosure
                        enclosure = tag;
                        children = getChildren(enclosure);
                        enclosureChildTags = new ArrayList<Tag>();
                    } else if (tag.getType() == Tag.Type.CLOSE) {
                        // tidy up on close tag
                        updateEnclosureChildId(enclosure, children,
                                enclosureChildTags);
                        enclosure = null;
                        children = null;
View Full Code Here

                String childid = children.get(i);
                if (childid != null) {
                    child += (child.length() > 0 ? Component.PATH_SEPARATOR
                            : "") + childid;
                } else {
                    Tag tag = enclosureChildTags.get(i);
                    String id = getGeneratedTagId(tag);
                    if (id != null) {
                        // nested children are delimited by commas
                        child += (child.length() > 0 ? Component.PATH_SEPARATOR
                                : "") + id;
View Full Code Here

TOP

Related Classes of org.brixcms.markup.tag.Tag

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.