Package org.apache.cocoon.stax.navigation

Examples of org.apache.cocoon.stax.navigation.Navigator


     * @param events list for caching non link info specific events.
     * @return a linkInfo object
     * @throws XMLStreamException
     */
    private LinkInfo collectLinkInfo(List<XMLEvent> events) throws XMLStreamException {
        Navigator linkInfoNavigator = new InSubtreeNavigator(LINK_INFO_EL);
        Navigator linkInfoPartNavigator = new FindStartElementNavigator(LINK_PART_INFO_EL);
        LinkInfo linkInfo = null;

        while (this.getParent().hasNext()) {
            XMLEvent event = this.getParent().peek();

            if (linkInfoNavigator.fulfillsCriteria(event)) {
                event = this.getParent().nextEvent();
                if (linkInfoPartNavigator.fulfillsCriteria(event)) {
                    if (linkInfo == null) {
                        throw new ProcessingException(new NullPointerException(
                                "The LinkInfo object mustn't be null here."));
                    }

View Full Code Here


    /**
     * Creates a new {@link IncludeTransformer} that includes a xml document into another at the
     * place where a include tag is found pointing at the document to include.
     */
    public IncludeTransformer() {
        this.isIncludeStart = new Navigator() {

            private boolean active;

            public boolean fulfillsCriteria(XMLEvent event) {
                if (event.isStartElement()) {
                    this.active = event.asStartElement().getName().equals(IncludeTransformer.INCLUDE_QNAME);
                    return this.active;
                }
                this.active = false;
                return this.active;
            }

            public boolean isActive() {
                return this.active;
            }
        };
        this.isIncludeEnd = new Navigator() {

            private boolean active;

            public boolean fulfillsCriteria(XMLEvent event) {
                if (event.isEndElement()) {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.stax.navigation.Navigator

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.