Java Code Examples for javax.xml.stream.Location#getCharacterOffset()

The following examples show how to use javax.xml.stream.Location#getCharacterOffset() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocationImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 2
Source File: LocationImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 3
Source File: LocationImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 4
Source File: LocationImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 5
Source File: LocationImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 6
Source File: LocationImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 7
Source File: LocationImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 8
Source File: LocationImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 9
Source File: LocationImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
LocationImpl(Location loc){
    systemId = loc.getSystemId();
    publicId = loc.getPublicId();
    lineNo = loc.getLineNumber();
    colNo = loc.getColumnNumber();
    charOffset = loc.getCharacterOffset();
}
 
Example 10
Source File: StaxUtils.java    From cxf with Apache License 2.0 5 votes vote down vote up
private static boolean addLocation(Document doc, Node node,
                                   Location loc,
                                   boolean recordLoc) {
    if (recordLoc && 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;
                }
                public int getLineNumber() {
                    return linNum;
                }
                public String getPublicId() {
                    return pubId;
                }
                public String getSystemId() {
                    return sysId;
                }
            };
            node.setUserData("location", loc2, LocationUserDataHandler.INSTANCE);
        } catch (Throwable ex) {
            //possibly not DOM level 3, won't be able to record this then
            return false;
        }
    }
    return recordLoc;
}
 
Example 11
Source File: BaseXhtmlFormat.java    From cosmo with Apache License 2.0 4 votes vote down vote up
protected void handleException(String message, Location location) throws ParseException {
    int offset = location != null ? location.getCharacterOffset() : -1;
    throw new ParseException(message, offset);
}