Refine search
/** * Creates a location from the SAX locator using the system ID as * the filename. * * @param loc Must not be <code>null</code>. * * @since Ant 1.6 */ public Location(Locator loc) { this(loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber()); }
/** * Formats the current document location. */ private String getLocation() { return locator.getSystemId() + ':' + locator.getLineNumber(); }
/** * Set a location associated with the exception. * @param locator the locator holding the location. */ public void setLocator(Locator locator) { if (locator != null) { this.systemId = locator.getSystemId(); this.line = locator.getLineNumber(); this.column = locator.getColumnNumber(); } }
private static String appendLocationInfo(String message, Locator[] location) { StringBuilder buf = new StringBuilder(message); for( Locator loc : location ) buf.append('\n').append(UtilMessages.UTIL_LOCATION( loc.getLineNumber(), loc.getSystemId() )); return buf.toString(); }
/** * Constructs an object from an org.xml.sax.Locator. * * The object's ColumnNumber, LineNumber, and URL become available from the * values returned by the locator's getColumnNumber(), getLineNumber(), and * getSystemId() methods respectively. Node, Object, and Offset are not * available. * * @param loc the SAX Locator object that will be used to populate this * event locator. * @throws IllegalArgumentException if the Locator is null */ public ValidationEventLocatorImpl( Locator loc ) { if( loc == null ) { throw new IllegalArgumentException( Messages.format( Messages.MUST_NOT_BE_NULL, "loc" ) ); } this.url = toURL(loc.getSystemId()); this.columnNumber = loc.getColumnNumber(); this.lineNumber = loc.getLineNumber(); }
public void validateThis() { if(_use == SOAPUse.ENCODED) { throw new ValidationException("validation.unsupportedUse.encoded", getLocator().getLineNumber(),getLocator().getSystemId()); } }
/** * Create a new SAXParseException from a message and a Locator. * * <p>This constructor is especially useful when an application is * creating its own exception from within a {@link org.xml.sax.ContentHandler * ContentHandler} callback.</p> * * @param message The error or warning message. * @param locator The locator object for the error or warning (may be * null). * @see org.xml.sax.Locator */ public SAXParseException (String message, Locator locator) { super(message); if (locator != null) { init(locator.getPublicId(), locator.getSystemId(), locator.getLineNumber(), locator.getColumnNumber()); } else { init(null, null, -1, -1); } }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * Wrap an existing exception in a SAXParseException. * * <p>This constructor is especially useful when an application is * creating its own exception from within a {@link org.xml.sax.ContentHandler * ContentHandler} callback, and needs to wrap an existing exception that is not a * subclass of {@link org.xml.sax.SAXException SAXException}.</p> * * @param message The error or warning message, or null to * use the message from the embedded exception. * @param locator The locator object for the error or warning (may be * null). * @param e Any exception. * @see org.xml.sax.Locator */ public SAXParseException (String message, Locator locator, Exception e) { super(message, e); if (locator != null) { init(locator.getPublicId(), locator.getSystemId(), locator.getLineNumber(), locator.getColumnNumber()); } else { init(null, null, -1, -1); } }
/** * Store the source location of the current node. This method must be called * as every node is added to the DTM or for no node. */ protected void setSourceLocation() { m_sourceSystemId.addElement(m_locator.getSystemId()); m_sourceLine.addElement(m_locator.getLineNumber()); m_sourceColumn.addElement(m_locator.getColumnNumber()); //%REVIEW% %BUG% Prevent this from arising in the first place // by not allowing the enabling conditions to change after we start // building the document. if (m_sourceSystemId.size() != m_size) { String msg = "CODING ERROR in Source Location: " + m_size + " != " + m_sourceSystemId.size(); System.err.println(msg); throw new RuntimeException(msg); } }
/** * Constructor SAXSourceLocator * * * @param locator Source locator */ public SAXSourceLocator(Locator locator) { m_locator = locator; this.setColumnNumber(locator.getColumnNumber()); this.setLineNumber(locator.getLineNumber()); this.setPublicId(locator.getPublicId()); this.setSystemId(locator.getSystemId()); }
/** * Constructor SAXSourceLocator * * * @param locator Source locator */ public SAXSourceLocator(Locator locator) { m_locator = locator; this.setColumnNumber(locator.getColumnNumber()); this.setLineNumber(locator.getLineNumber()); this.setPublicId(locator.getPublicId()); this.setSystemId(locator.getSystemId()); }
/** * Copy constructor. * * <p>Create a persistent copy of the current state of a locator. * When the original locator changes, this copy will still keep * the original values (and it can be used outside the scope of * DocumentHandler methods).</p> * * @param locator The locator to copy. */ public LocatorImpl (Locator locator) { setPublicId(locator.getPublicId()); setSystemId(locator.getSystemId()); setLineNumber(locator.getLineNumber()); setColumnNumber(locator.getColumnNumber()); }
/** * Copy constructor. * * <p>Create a persistent copy of the current state of a locator. * When the original locator changes, this copy will still keep * the original values (and it can be used outside the scope of * DocumentHandler methods).</p> * * @param locator The locator to copy. */ public SerializableLocatorImpl (org.xml.sax.Locator locator) { setPublicId(locator.getPublicId()); setSystemId(locator.getSystemId()); setLineNumber(locator.getLineNumber()); setColumnNumber(locator.getColumnNumber()); }
m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId());
m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId());
m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId());
m_locator.setColumnNumber(loc.getColumnNumber()); m_locator.setLineNumber(loc.getLineNumber()); m_locator.setPublicId(loc.getPublicId()); m_locator.setSystemId(loc.getSystemId());
task.setTaskName(qname); Location location = new Location(context.getLocator().getSystemId(), context .getLocator().getLineNumber(), context.getLocator().getColumnNumber()); task.setLocation(location); task.setOwningTarget(context.getCurrentTarget());
if (node instanceof Locator) { Locator loc = (Locator) node; fLocator.setColumnNumber(loc.getColumnNumber()); fLocator.setLineNumber(loc.getLineNumber()); fLocator.setPublicId(loc.getPublicId()); fLocator.setSystemId(loc.getSystemId()); } else { fLocator.setColumnNumber(0);