Package org.apache.cocoon.util.location

Examples of org.apache.cocoon.util.location.Location


     * <p>
     * As a convenience, the node is returned by this method to allow constructs
     * like <code>return treeBuilder.setupNode(new MyNode(), config)</code>.
     */
    public ProcessingNode setupNode(ProcessingNode node, Configuration config) throws Exception {
        Location location = getLocation(config);
        if (node instanceof AbstractProcessingNode) {
            ((AbstractProcessingNode) node).setLocation(location);
            ((AbstractProcessingNode) node).setSitemapExecutor(this.processor.getSitemapExecutor());
        }

View Full Code Here


        if (type != null) {
            desc.append(" type=\"").append(type).append('"');
        }
        desc.append('>');

        Location rawLoc = LocationUtils.getLocation(config);
        return new LocationImpl(desc.toString(),
                                rawLoc.getURI(),
                                rawLoc.getLineNumber(),
                                rawLoc.getColumnNumber());
    }
View Full Code Here

     * a list of Maps used for resolution.
     *
     * @return a fully resolved <code>Parameters</code>.
     */
    public static Parameters buildParameters(Map expressions, InvokeContext context, Map objectModel) throws PatternException {
        Location location;
        if (expressions instanceof Locatable) {
            location = ((Locatable) expressions).getLocation();
        } else {
            location = Location.UNKNOWN;
        }
        if (expressions == null || expressions.size() == 0 && location.equals(Location.UNKNOWN)) {
            return Parameters.EMPTY_PARAMETERS;
        }

        SitemapParameters result = new SitemapParameters(location);

View Full Code Here

        return expires;
    }

    protected Location getLocation(Parameters param) {
        Location location = null;
        if (param instanceof Locatable) {
            location = ((Locatable)param).getLocation();
        }
        if (location == null) {
            location = Location.UNKNOWN;
View Full Code Here

     * As a convenience, the node is returned by this method to allow constructs
     * like <code>return treeBuilder.setupNode(new MyNode(), config)</code>.
     */
    public ProcessingNode setupNode(ProcessingNode node, Configuration config)
      throws Exception {
        Location location = getLocation(config);
        if (node instanceof AbstractProcessingNode) {
            ((AbstractProcessingNode)node).setLocation(location);
        }

        this.lifecycle.setupComponent(node, false);
View Full Code Here

        if (type != null) {
            desc.append(" type=\"").append(type).append('"');
        }
        desc.append('>');
       
        Location rawLoc = LocationUtils.getLocation(config, null);
        return new LocationImpl(desc.toString(), rawLoc.getURI(), rawLoc.getLineNumber(), rawLoc.getColumnNumber());
    }
View Full Code Here

        handler.startPrefixMapping("ex", EXCEPTION_NS);
        attr.addCDATAAttribute("class", root.getClass().getName());
        handler.startElement(EXCEPTION_NS, "exception-report", "ex:exception-report", attr);
       
        // Root exception location
        Location loc = LocationUtils.getLocation(root);       
        if (LocationUtils.isKnown(loc)) {
            attr.clear();
            dumpLocation(loc, attr, handler);
        }
View Full Code Here

            stack.push(lastEvent);
        }

        public void startElement(String namespaceURI, String localName, String qname, Attributes attrs) throws SAXException {
            Event newEvent = null;
            Location locator = LocationUtils.getLocation(this.locator, "<"+qname+">");
            AttributesImpl elementAttributes = new AttributesImpl(attrs);
            int attributeCount = elementAttributes.getLength();
            for (int i = 0; i < attributeCount; i++) {
                String attributeURI = elementAttributes.getURI(i);
                if (StringUtils.equals(attributeURI, NS)) {
View Full Code Here

     * a list of Maps used for resolution.
     *
     * @return a fully resolved <code>Parameters</code>.
     */
    public static Parameters buildParameters(Map expressions, InvokeContext context, Map objectModel) throws PatternException {
        Location location;
        if (expressions instanceof Locatable) {
            location = ((Locatable)expressions).getLocation();
        } else {
            location = Location.UNKNOWN;
        }
       
        if (expressions == null || expressions.size() == 0 && location.equals(Location.UNKNOWN)) {
            return Parameters.EMPTY_PARAMETERS;
        }

        SitemapParameters result = new SitemapParameters(location);

View Full Code Here

     * @param param
     * @return the location
     * @since 2.1.8
     */
    public static Location getLocation(Parameters param) {
        Location loc = null;
        if (param instanceof Locatable) {
            loc = ((Locatable)param).getLocation();
        }
        return loc == null ? Location.UNKNOWN : loc;
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.util.location.Location

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.