home *** CD-ROM | disk | FTP | other *** search
- package netscape.palomar.sgml;
-
- import netscape.palomar.util.CascadedException;
-
- public class SGMLAttributeImpl implements SGMLAttribute {
- protected String _rawValue;
- protected String _name;
- protected String _unicodeValue;
- protected SGMLParser _parser;
-
- public SGMLAttributeImpl(String name, String value, SGMLParser parser) {
- this._name = name;
- this._rawValue = value;
- this._parser = parser;
- }
-
- public String getRawValue() {
- if (this._rawValue == null) {
- this._rawValue = this._parser.escapeText(this._unicodeValue);
- }
-
- return this._rawValue;
- }
-
- public void setRawValue(String newValue) {
- this._rawValue = newValue;
- this._unicodeValue = null;
- }
-
- public String getUnicode() throws CascadedException {
- if (this._unicodeValue == null) {
- this._unicodeValue = this._parser.unEscapeText(this._rawValue);
- }
-
- return this._unicodeValue;
- }
-
- public void setUnicode(String newUni) throws CascadedException {
- this._unicodeValue = newUni;
- this._rawValue = null;
- }
-
- public String getName() {
- return this._name;
- }
- }
-