Package org.apache.cocoon.util.location

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


        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


    public void addWidgetDefinition(WidgetDefinition widgetDefinition) throws DuplicateIdException {
        String id = widgetDefinition.getId();
        // Do not add NewDefinition id's hash.
        if (!(widgetDefinition instanceof NewDefinition)) {
            if (widgetDefinitionsById.containsKey(id)) {
                Location containerLocation = containerDefinition.getLocation();
                Location firstLocation = getWidgetDefinition(id).getLocation();
                throw new DuplicateIdException(
                    "Detected duplicate widget id '" + id + "'.\n" +
                    "Container widget '" + containerDefinition.getId() + "' at " + containerLocation + "\n" +
                    "already contains a widget with the same id at " + firstLocation + ".",
                        widgetDefinition);
View Full Code Here

                }
                if (widgetDefinition instanceof RepeaterDefinition) {
                    break;
                }
                if (widgetDefinition == containerDefinition) {
                    Location location = containerDefinition.getLocation();
                    if (parent instanceof FormDefinition) {
                        throw new FormsException("Container: Non-terminating recursion detected in form definition.",
                                                 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

        handler.startPrefixMapping("ex", EXCEPTION_NS);
        attr.addCDATAAttribute("class", cause.getClass().getName());
        handler.startElement(EXCEPTION_NS, "exception-report", "ex:exception-report", attr);

        // Root cause exception location
        Location loc = LocationUtils.getLocation(cause);
        if (LocationUtils.isKnown(loc)) {
            attr.clear();
            dumpLocation(loc, attr, handler);
        }
View Full Code Here

    public Throwable getThrowable() {
        if (exception == null) {
            return null;
        }

        Location loc = LocationUtils.getLocation(exception);
        if (LocationUtils.isKnown(loc)) {
            // Has a location: don't loose this precious information!
            return exception;
        }
View Full Code Here

        // "DEBUG:A debug message" or "INFO:Transforming <foo> in mode 'bar'" to use the different
        // log levels. This can include also deprecation logs for system-defined stylesheets
        // using "DEPRECATED:WARN:Styling 'foo' is replaced by 'bar'".

        if (logger.isWarnEnabled()) {
            Location loc = LocationUtils.getLocation(ex);
            logger.warn(ex.getMessage() + " at "+ loc == null ? uri : loc.toString());
        }
        // Keep the warning (see below)
        warningEx = ex;
    }
View Full Code Here

    public Throwable getThrowable() {
        if (exception == null) {
            return null;
        }
       
        Location loc = LocationUtils.getLocation(exception);
        if (LocationUtils.isKnown(loc)) {
            // Has a location: don't loose this precious information!
            return exception;
        }
       
View Full Code Here

        // "DEBUG:A debug message" or "INFO:Transforming <foo> in mode 'bar'" to use the different
        // log levels. This can include also deprecation logs for system-defined stylesheets
        // using "DEPRECATED:WARN:Styling 'foo' is replaced by 'bar'".   

        if (getLogger().isWarnEnabled()) {
            Location loc = LocationUtils.getLocation(ex);
            getLogger().warn(ex.getMessage() + " at " + (loc == null ? uri : loc.toString()));
        }

        // Keep the warning (see below)
        warningEx = ex;
    }
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.