Ejemplo n.º 1
0
 /**
  * Removes the given Wildcard from this Group.
  *
  * @param wilcard the Wildcard to remove.
  * @return true if the wildcard has been successfully removed, false otherwise.
  */
 public boolean removeWildcard(Wildcard wildcard) {
   if (wildcard == null) return false;
   if (wildcard.equals(_anyAttribute)) {
     _anyAttribute = null;
     return true;
   }
   return false;
 }
Ejemplo n.º 2
0
  /**
   * Sets the wildcard (anyAttribute) of the complexType
   *
   * @exception SchemaException thrown when a wildcard as already be set or when the wildCard is not
   *     an <anyAttribute>.
   */
  public void setAnyAttribute(Wildcard wildcard) throws SchemaException {
    if (wildcard != null) {
      if (_anyAttribute != null) {
        String err = "<anyAttribute> already set in this complexType: " + this.getName();
        throw new SchemaException(err);
      }

      if (!wildcard.isAttributeWildcard()) {
        String err = "In complexType, " + this.getName() + "the wildcard must be an <anyAttribute>";
        throw new SchemaException(err);
      }
    }
    _anyAttribute = wildcard;
  }