Package javax.xml.stream

Examples of javax.xml.stream.Location


    }
    public String getPublicId() {
        return null;
    }
    public Location getLocation() {
        return new Location() {

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


    }
    private static boolean addLocation(Document doc, Node node,
                                    XMLStreamReader reader,
                                    boolean recordLoc) {
        if (recordLoc) {
            Location loc = reader.getLocation();
            if (loc != null && (loc.getColumnNumber() != 0 || loc.getLineNumber() != 0)) {
                try {
                    final int charOffset = loc.getCharacterOffset();
                    final int colNum = loc.getColumnNumber();
                    final int linNum = loc.getLineNumber();
                    final String pubId = loc.getPublicId() == null ? doc.getDocumentURI() : loc.getPublicId();
                    final String sysId = loc.getSystemId() == null ? doc.getDocumentURI() : loc.getSystemId();
                    Location loc2 = new Location() {
                        public int getCharacterOffset() {
                            return charOffset;
                        }
                        public int getColumnNumber() {
                            return colNum;
View Full Code Here

        StAXAttributeProcessor<?> processor = null;
       
        //lookup for registered attribute processors
        processor = (StAXAttributeProcessor<?>)processors.getProcessor(attributeName);
        if (processor == null) {
          Location location = source.getLocation();
            if (logger.isLoggable(Level.WARNING)) {               
                logger.warning("Attribute " + attributeName + " cannot be processed. (" + location + ")");
            }
            warning("AttributeCannotBeProcessed", processors, attributeName, location);           
        } else {
          return processor.read(attributeName, source);
        }
       
       
        //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("DefaultAttributeProcessorNotAvailable", processors, ANY_ATTRIBUTE, location);           
        }         
View Full Code Here

            source.nextTag();
        }
        QName name = source.getName();
        StAXArtifactProcessor<?> processor = (StAXArtifactProcessor<?>)processors.getProcessor(name);
        if (processor == null) {
          Location location = source.getLocation();
            if (logger.isLoggable(Level.WARNING)) {               
                logger.warning("Element " + name + " cannot be processed. (" + location + ")");
            }
            warning("ElementCannotBeProcessed", processors, name, location);
View Full Code Here

                      error("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("ContributionReadException", reader, e);
                    throw e;
                } finally {
                    try {
                        reader.close();
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

    }
    private static boolean addLocation(Document doc, Node node,
                                    XMLStreamReader reader,
                                    boolean recordLoc) {
        if (recordLoc) {
            Location loc = reader.getLocation();
            if (loc != null && (loc.getColumnNumber() != 0 || loc.getLineNumber() != 0)) {
                try {
                    final int charOffset = loc.getCharacterOffset();
                    final int colNum = loc.getColumnNumber();
                    final int linNum = loc.getLineNumber();
                    final String pubId = loc.getPublicId() == null ? doc.getDocumentURI() : loc.getPublicId();
                    final String sysId = loc.getSystemId() == null ? doc.getDocumentURI() : loc.getSystemId();
                    Location loc2 = new Location() {
                        public int getCharacterOffset() {
                            return charOffset;
                        }
                        public int getColumnNumber() {
                            return colNum;
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.