예제 #1
0
 /**
  * Create a new simple type which is derived by list from another simple type.
  *
  * @param name name of the new type, could be null
  * @param targetNamespace target namespace of the new type, could be null
  * @param finalSet value of "final"
  * @param itemType item type of the list type
  * @param annotations set of annotations
  * @return the newly created simple type
  */
 public XSSimpleType createTypeList(
     String name,
     String targetNamespace,
     short finalSet,
     XSSimpleType itemType,
     XSObjectList annotations) {
   if (fDeclPool != null) {
     XSSimpleTypeDecl st = fDeclPool.getSimpleTypeDecl();
     return st.setListValues(
         name, targetNamespace, finalSet, (XSSimpleTypeDecl) itemType, annotations);
   }
   return new XSSimpleTypeDecl(
       name, targetNamespace, finalSet, (XSSimpleTypeDecl) itemType, false, annotations);
 }
예제 #2
0
  /**
   * Create a new simple type which is derived by restriction from another simple type.
   *
   * @param name name of the new type, could be null
   * @param targetNamespace target namespace of the new type, could be null
   * @param finalSet value of "final"
   * @param base base type of the new type
   * @param annotations set of annotations
   * @return the newly created simple type
   */
  public XSSimpleType createTypeRestriction(
      String name,
      String targetNamespace,
      short finalSet,
      XSSimpleType base,
      XSObjectList annotations) {

    if (fDeclPool != null) {
      XSSimpleTypeDecl st = fDeclPool.getSimpleTypeDecl();
      return st.setRestrictionValues(
          (XSSimpleTypeDecl) base, name, targetNamespace, finalSet, annotations);
    }
    return new XSSimpleTypeDecl(
        (XSSimpleTypeDecl) base, name, targetNamespace, finalSet, false, annotations);
  }
예제 #3
0
  /**
   * Create a new simple type which is derived by union from a list of other simple types.
   *
   * @param name name of the new type, could be null
   * @param targetNamespace target namespace of the new type, could be null
   * @param finalSet value of "final"
   * @param memberTypes member types of the union type
   * @param annotations set of annotations
   * @return the newly created simple type
   */
  public XSSimpleType createTypeUnion(
      String name,
      String targetNamespace,
      short finalSet,
      XSSimpleType[] memberTypes,
      XSObjectList annotations) {
    int typeNum = memberTypes.length;
    XSSimpleTypeDecl[] mtypes = new XSSimpleTypeDecl[typeNum];
    System.arraycopy(memberTypes, 0, mtypes, 0, typeNum);

    if (fDeclPool != null) {
      XSSimpleTypeDecl st = fDeclPool.getSimpleTypeDecl();
      return st.setUnionValues(name, targetNamespace, finalSet, mtypes, annotations);
    }
    return new XSSimpleTypeDecl(name, targetNamespace, finalSet, mtypes, annotations);
  }