home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Premium Edition) / mycd.iso / INTERNET / NETSCAP4.06 / CP32E406.EXE / netcast.z / ncjava10.jar / netscape / palomar / sgml / SGMLAttributeImpl.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  1.4 KB  |  47 lines

  1. package netscape.palomar.sgml;
  2.  
  3. import netscape.palomar.util.CascadedException;
  4.  
  5. public class SGMLAttributeImpl implements SGMLAttribute {
  6.    protected String _rawValue;
  7.    protected String _name;
  8.    protected String _unicodeValue;
  9.    protected SGMLParser _parser;
  10.  
  11.    public SGMLAttributeImpl(String name, String value, SGMLParser parser) {
  12.       this._name = name;
  13.       this._rawValue = value;
  14.       this._parser = parser;
  15.    }
  16.  
  17.    public String getRawValue() {
  18.       if (this._rawValue == null) {
  19.          this._rawValue = this._parser.escapeText(this._unicodeValue);
  20.       }
  21.  
  22.       return this._rawValue;
  23.    }
  24.  
  25.    public void setRawValue(String newValue) {
  26.       this._rawValue = newValue;
  27.       this._unicodeValue = null;
  28.    }
  29.  
  30.    public String getUnicode() throws CascadedException {
  31.       if (this._unicodeValue == null) {
  32.          this._unicodeValue = this._parser.unEscapeText(this._rawValue);
  33.       }
  34.  
  35.       return this._unicodeValue;
  36.    }
  37.  
  38.    public void setUnicode(String newUni) throws CascadedException {
  39.       this._unicodeValue = newUni;
  40.       this._rawValue = null;
  41.    }
  42.  
  43.    public String getName() {
  44.       return this._name;
  45.    }
  46. }
  47.