Пример #1
0
 public Object getProperty(String name) throws java.lang.IllegalArgumentException {
   if (name == null) {
     throw new IllegalArgumentException("Property not supported");
   }
   if (fPropertyManager.containsProperty(name)) return fPropertyManager.getProperty(name);
   throw new IllegalArgumentException("Property not supported");
 }
Пример #2
0
 public boolean isPropertySupported(String name) {
   if (name == null) {
     return false;
   } else {
     return fPropertyManager.containsProperty(name);
   }
 }
Пример #3
0
  public void setProperty(String name, Object value) throws java.lang.IllegalArgumentException {
    if (name == null || value == null || !fPropertyManager.containsProperty(name)) {
      throw new IllegalArgumentException("Property " + name + "is not supported");
    }
    if (name == Constants.REUSE_INSTANCE || name.equals(Constants.REUSE_INSTANCE)) {
      fReuseInstance = ((Boolean) value).booleanValue();
      if (DEBUG) System.out.println("fReuseInstance is set to " + fReuseInstance);

      // TODO: XMLStreamWriters are not Thread safe,
      // don't let application think it is optimizing
      if (fReuseInstance) {
        throw new IllegalArgumentException(
            "Property " + name + " is not supported: XMLStreamWriters are not Thread safe");
      }
    } else { // for any other property set the flag
      // REVISIT: Even in this case instance can be reused, by passing PropertyManager
      fPropertyChanged = true;
    }
    fPropertyManager.setProperty(name, value);
  }