1 16 17 package org.apache.xerces.dom; 18 19 import org.w3c.dom.DOMError ; 20 import org.w3c.dom.DOMLocator ; 21 import org.apache.xerces.xni.parser.XMLParseException; 22 23 24 40 41 45 public class DOMErrorImpl implements DOMError { 46 47 51 public short fSeverity = DOMError.SEVERITY_WARNING; 52 public String fMessage = null; 53 public DOMLocatorImpl fLocator = new DOMLocatorImpl(); 54 public Exception fException = null; 55 public String fType; 56 public Object fRelatedData; 57 58 59 60 64 65 public DOMErrorImpl () { 66 } 67 68 69 public DOMErrorImpl (short severity, XMLParseException exception) { 70 fSeverity = severity; 71 fException = exception; 72 fLocator = createDOMLocator (exception); 73 } 74 75 79 80 public short getSeverity() { 81 return fSeverity; 82 } 83 84 87 88 public String getMessage() { 89 return fMessage; 90 } 91 92 95 96 public DOMLocator getLocation() { 97 return fLocator; 98 } 99 100 private DOMLocatorImpl createDOMLocator(XMLParseException exception) { 102 return new DOMLocatorImpl(exception.getLineNumber(), 104 exception.getColumnNumber(), 105 exception.getCharacterOffset(), 106 exception.getExpandedSystemId()); 107 } 109 110 115 public Object getRelatedException(){ 116 return fException; 117 } 118 119 public void reset(){ 120 fSeverity = DOMError.SEVERITY_WARNING; 121 fException = null; 122 } 123 124 public String getType(){ 125 return fType; 126 } 127 128 public Object getRelatedData(){ 129 return fRelatedData; 130 } 131 132 133 } | Popular Tags |