Package javax.xml.stream

Examples of javax.xml.stream.Location


        return (currentEvent == CHARACTERS || currentEvent == DTD || currentEvent == ENTITY_REFERENCE
                        || currentEvent == COMMENT || currentEvent == SPACE);
    }

    public Location getLocation() {
        return new Location() {

            public int getCharacterOffset() {
                return 0;
            }
View Full Code Here


            source.nextTag();
        }
        QName name = source.getName();
        StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(name);
        if (processor == null) {
            Location location = source.getLocation();
            error(monitor, "ElementCannotBeProcessed", processors, name, location);

            StAXArtifactProcessor anyElementProcessor = processors.getProcessor(ANY_ELEMENT);
            if (anyElementProcessor != null) {
                return anyElementProcessor.read(source, context);
View Full Code Here

                        error(monitor, "UnrecognizedElementException", reader, name);
                        UnrecognizedElementException e = new UnrecognizedElementException(name);
                        throw e;
                    }
                } catch (ContributionReadException e) {
                    Location location = reader.getLocation();
                    e.setLine(location.getLineNumber());
                    e.setColumn(location.getColumnNumber());
                    error(monitor, "ContributionReadException", reader, e);
                    throw e;
                } finally {
                    try {
                        reader.close();
View Full Code Here

        StAXAttributeProcessor<?> processor = null;

        //lookup for registered attribute processors
        processor = (StAXAttributeProcessor<?>)processors.getProcessor(attributeName);
        if (processor == null) {
            Location location = source.getLocation();
            // Skip xsi:type, xsi:nil and xsi:schemaLocation etc
            if (!W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(attributeName.getNamespaceURI())) {
                if (logger.isLoggable(Level.WARNING)) {
                    logger.warning("Attribute " + attributeName + " cannot be processed. (" + location + ")");
                }
                warning(context.getMonitor(), "AttributeCannotBeProcessed", processors, attributeName, location);
            }
        } else {
            return processor.read(attributeName, source, context);
        }

        //handle extension attributes without processors
        processor = (StAXAttributeProcessor<?>)processors.getProcessor(ANY_ATTRIBUTE);
        if (processor == null) {
            Location location = source.getLocation();
            if (logger.isLoggable(Level.WARNING)) {
                logger.warning("Could not find Default Attribute processor !");
            }
            warning(context.getMonitor(), "DefaultAttributeProcessorNotAvailable", processors, ANY_ATTRIBUTE, location);
        }
View Full Code Here

        private LocatorAdapter() {
        }

        public int getColumnNumber() {
            Location location = getLocation();
            return location == null ? 0 : location.getColumnNumber();
        }
View Full Code Here

            Location location = getLocation();
            return location == null ? 0 : location.getColumnNumber();
        }

        public int getLineNumber() {
            Location location = getLocation();
            return location == null ? 0 : location.getLineNumber();
        }
View Full Code Here

            Location location = getLocation();
            return location == null ? 0 : location.getLineNumber();
        }

        public String getPublicId() {
            Location location = getLocation();
            return location == null ? "" : location.getPublicId();
        }
View Full Code Here

            Location location = getLocation();
            return location == null ? "" : location.getPublicId();
        }

        public String getSystemId() {
            Location location = getLocation();
            return location == null ? "" : location.getSystemId();
        }
View Full Code Here

    public Location getLocation() {
        if (reader != null) {
            return reader.getLocation();
        }
        // return a default location
        return new Location() {
            public int getCharacterOffset() {
                return 0;
            }

            public int getColumnNumber() {
View Full Code Here

    /**
     */
    public Location getLocation() {
        // return a default location
        return new Location() {
            public int getCharacterOffset() {
                return 0;
            }

            public int getColumnNumber() {
View Full Code Here

TOP

Related Classes of javax.xml.stream.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.