示例#1
0
  /**
   * INTERNAL: Make this Type an opened Type to allow open content by assigning true value or a Type
   * not to accept any additional properties by assigning false value, {@link isOpen()}.
   *
   * @param bOpen boolean value implying if this Type is open
   */
  public void setOpen(boolean bOpen) {
    if (isDataType() && bOpen) {
      throw SDOException.typeCannotBeOpenAndDataType(getURI(), getName());
    }
    if (open != bOpen) {
      open = bOpen;
      if (open) {
        if (isSubType()) {
          Type baseType = (Type) getBaseTypes().get(0);
          if (!baseType.isOpen()) {
            addOpenMappings();
          }
        } else {
          addOpenMappings();
        }

        if (isBaseType()) {
          for (int i = 0; i < getSubTypes().size(); i++) {
            SDOType nextSubType = (SDOType) getSubTypes().get(i);
            nextSubType.setOpen(bOpen);
          }
        }
      }
    }
  }
示例#2
0
 /**
  * INTERNAL: Set this Type to a simple Type by passing in boolean value true. Otherwise, If
  * boolean value is passed in, instances of this type implement DataObject.
  *
  * @param datatype boolean value implying if it is a simple Type
  */
 public void setDataType(boolean datatype) {
   if (datatype && isOpen()) {
     throw SDOException.typeCannotBeOpenAndDataType(getURI(), getName());
   }
   isDataType = datatype;
   if (datatype) {
     setFinalized(true);
   }
 }