1 57 58 package com.sun.org.apache.xerces.internal.dom; 59 60 import org.w3c.dom.DOMError ; 61 import org.w3c.dom.DOMLocator ; 62 import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; 63 64 65 79 80 84 public class DOMErrorImpl implements DOMError { 85 86 90 public short fSeverity = DOMError.SEVERITY_WARNING; 91 public String fMessage = null; 92 public DOMLocatorImpl fLocator = new DOMLocatorImpl(); 93 public Exception fException = null; 94 public String fType; 95 public Object fRelatedData; 96 97 98 99 103 104 public DOMErrorImpl () { 105 } 106 107 108 public DOMErrorImpl (short severity, XMLParseException exception) { 109 fSeverity = severity; 110 fException = exception; 111 fLocator = createDOMLocator (exception); 112 } 113 114 118 119 public short getSeverity() { 120 return fSeverity; 121 } 122 123 126 127 public String getMessage() { 128 return fMessage; 129 } 130 131 134 135 public DOMLocator getLocation() { 136 return fLocator; 137 } 138 139 private DOMLocatorImpl createDOMLocator(XMLParseException exception) { 141 return new DOMLocatorImpl(exception.getLineNumber(), 143 exception.getColumnNumber(), 144 exception.getExpandedSystemId() 145 ); 146 } 148 149 154 public Object getRelatedException(){ 155 return fException; 156 } 157 158 public void reset(){ 159 fSeverity = DOMError.SEVERITY_WARNING; 160 fException = null; 161 } 162 163 public String getType(){ 164 return fType; 165 } 166 167 public Object getRelatedData(){ 168 return fRelatedData; 169 } 170 171 172 } | Popular Tags |