Esempio n. 1
0
 static DocType build(String rootElementName, String publicID, String systemID) {
   DocType result = new DocType();
   result.publicID = publicID;
   result.systemID = systemID;
   result.rootName = rootElementName;
   return result;
 }
 @Override
 public int hashCode() {
   int result = CancelCode != null ? CancelCode.hashCode() : 0;
   result = 31 * result + (DocType != null ? DocType.hashCode() : 0);
   result = 31 * result + (CompanyCode != null ? CompanyCode.hashCode() : 0);
   result = 31 * result + (DocCode != null ? DocCode.hashCode() : 0);
   return result;
 }
Esempio n. 3
0
  // LexicalHandler events
  public void startDTD(String rootName, String publicID, String systemID) {

    inDTD = true;
    DocType doctype = DocType.build(rootName, publicID, systemID);
    document.fastInsertChild(doctype, position);
    position++;
    internalDTDSubset = new StringBuffer();
    this.doctype = doctype;
  }
Esempio n. 4
0
  /**
   * This method tells you the line of the XML file being parsed. For an in-memory document, it's
   * meaningless. The location is only valid for the current parsing lifecycle, but the document has
   * already been parsed. Therefore, it returns -1 for both line and column numbers.
   *
   * @param document JDOM <code>Document</code>.
   */
  private void documentLocator(Document document) {
    locator = new JDOMLocator();
    String publicID = null;
    String systemID = null;

    if (document != null) {
      DocType docType = document.getDocType();
      if (docType != null) {
        publicID = docType.getPublicID();
        systemID = docType.getSystemID();
      }
    }
    locator.setPublicId(publicID);
    locator.setSystemId(systemID);
    locator.setLineNumber(-1);
    locator.setColumnNumber(-1);

    contentHandler.setDocumentLocator(locator);
  }