< prev index next >

src/java.xml/share/classes/com/sun/xml/internal/stream/events/StartDocumentEvent.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad


  56     }
  57 
  58     public StartDocumentEvent(String encoding, String version){
  59         init(encoding,version,true,null);
  60     }
  61 
  62     public StartDocumentEvent(String encoding, String version, boolean standalone){
  63         this.fStandaloneSet = true;
  64         init(encoding,version,standalone,null);
  65     }
  66 
  67     public StartDocumentEvent(String encoding, String version, boolean standalone,Location loc){
  68         this.fStandaloneSet = true;
  69         init(encoding, version, standalone, loc);
  70     }
  71     protected void init(String encoding, String version, boolean standalone,Location loc) {
  72         setEventType(XMLStreamConstants.START_DOCUMENT);
  73         this.fEncodingScheam = encoding;
  74         this.fVersion = version;
  75         this.fStandalone = standalone;
  76         if (encoding != null && !encoding.equals(""))
  77             this.fEncodingSchemeSet = true;
  78         else {
  79             this.fEncodingSchemeSet = false;
  80             this.fEncodingScheam = "UTF-8";
  81         }
  82         this.fLocation = loc;
  83     }
  84 
  85     public String getSystemId() {
  86         if(fLocation == null )
  87             return "";
  88         else
  89             return fLocation.getSystemId();
  90     }
  91 
  92 
  93     public String getCharacterEncodingScheme() {
  94         return fEncodingScheam;
  95     }
  96 




  56     }
  57 
  58     public StartDocumentEvent(String encoding, String version){
  59         init(encoding,version,true,null);
  60     }
  61 
  62     public StartDocumentEvent(String encoding, String version, boolean standalone){
  63         this.fStandaloneSet = true;
  64         init(encoding,version,standalone,null);
  65     }
  66 
  67     public StartDocumentEvent(String encoding, String version, boolean standalone,Location loc){
  68         this.fStandaloneSet = true;
  69         init(encoding, version, standalone, loc);
  70     }
  71     protected void init(String encoding, String version, boolean standalone,Location loc) {
  72         setEventType(XMLStreamConstants.START_DOCUMENT);
  73         this.fEncodingScheam = encoding;
  74         this.fVersion = version;
  75         this.fStandalone = standalone;
  76         if (encoding != null && !encoding.isEmpty())
  77             this.fEncodingSchemeSet = true;
  78         else {
  79             this.fEncodingSchemeSet = false;
  80             this.fEncodingScheam = "UTF-8";
  81         }
  82         this.fLocation = loc;
  83     }
  84 
  85     public String getSystemId() {
  86         if(fLocation == null )
  87             return "";
  88         else
  89             return fLocation.getSystemId();
  90     }
  91 
  92 
  93     public String getCharacterEncodingScheme() {
  94         return fEncodingScheam;
  95     }
  96 


< prev index next >