示例#1
0
  /**
   * Adds the given Group declaration to this Schema definition
   *
   * @param group the Group to add to this SchemaDef
   * @exception SchemaException when an Group already exists with the same name as the given
   *     ElementDecl
   */
  public void addModelGroup(ModelGroup group) throws SchemaException {

    String name = group.getName();

    if (name == null) {
      String err = "a group declaration must contain a name.";
      throw new SchemaException(err);
    }
    if (_group.get(name) != null) {
      String err = "an group declaration already exists with the given name: ";
      throw new SchemaException(err + name);
    }

    _group.put(name, group);
  } // -- addModelGroup
示例#2
0
 /**
  * Removes the given ModelGroup Definition from this ContentModelGroup.
  *
  * @param group the ModelGroup Definition to remove.
  * @return true if the group has been successfully removed, false otherwise.
  */
 public boolean removeGroup(ModelGroup group) {
   boolean result = _contentModel.removeGroup(group);
   group.setParent(null);
   return result;
 }
示例#3
0
  /**
   * Adds the given ModelGroup Definition to this ContentModelGroup
   *
   * @param group the ModelGroup to add
   * @exception SchemaException when a group with the same name as the specified group already
   *     exists in the current scope
   */
  public void addGroup(ModelGroup group) throws SchemaException {
    _contentModel.addGroup(group);

    // -- set reference to parent
    group.setParent(this);
  } // -- addGroup