static SimpleLocation defaultLocation = new SimpleLocation();
public String toString() { StringBuffer buffer = new StringBuffer(); String publicId = getPublicId(); String systemId = getSystemId(); if (publicId != null) { buffer.append(publicId); if (systemId != null) { buffer.append("#").append(systemId); } } else if (systemId != null) { buffer.append(publicId); } buffer.append('['); buffer.append("line=").append(getLineNumber()); buffer.append("column=").append(getColumnNumber()); buffer.append(']'); Location nested = getNestedLocation(); if (nested != null) { buffer.append("->"); buffer.append(nested); } return buffer.toString(); }
/** * Constructs a new, stable {@link Location} from the current stream location. * If the stream location implements {@link StaticLocation}, then the stream * location will be returned directly. * * @return Constructs a new, stable {@link Location} from the current stream * location, or the current {@link Location} itself if it is already * stable. */ public Location getStableLocation() { Location location = getLocation(); if (!(location instanceof StaticLocation)) { // create copy location = new SimpleLocation(location); } return location; }