Package javax.xml.stream

Examples of javax.xml.stream.Location


    public boolean hasText() {
        return state == TEXT_STATE;
    }

    public Location getLocation() {
        return new Location() {
            public int getLineNumber() {
                return 0;
            }

            public int getColumnNumber() {
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

        }
    }

    // Raises a Syntax error runtime exception
    protected static void syntaxError(XMLStreamReader reader) {
        Location location = reader.getLocation();
        String where = location.toString();
        String message = String.format("Syntax error @ %s", where);
        throw new RuntimeException(message);
    }
View Full Code Here

    public Location getCurrentLocation() {
        return xmlStreamReader.getLocation();
    }

    private void logException(Throwable exception) {
        Location streamReaderlocation = xmlStreamReader.getLocation();
        String message = "An error occurred at line number " + streamReaderlocation.getLineNumber();

        if (location != null) {
            message += " in file " + location.getPath();
        }
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

    }
    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

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

            public int getColumnNumber() {
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

        public boolean hasText() {
            return (state == TEXT_STATE);
        }

        public Location getLocation() {
            return new Location() {
                public int getLineNumber() {
                    return 0;
                }

                public int getColumnNumber() {
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.