org.apache.xmlbeans.impl.inst2xsd.util

## Class Type

- java.lang.Object
- - org.apache.xmlbeans.impl.inst2xsd.util.Type

-     public class Type
      extends Object

  Author:
    Cezar Andrei (cezar.andrei at bea.com) Date: Jul 16, 2004

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `COMPLEX_TYPE_COMPLEX_CONTENT`
    `static int` | `COMPLEX_TYPE_EMPTY_CONTENT`
    `static int` | `COMPLEX_TYPE_MIXED_CONTENT`
    `static int` | `COMPLEX_TYPE_SIMPLE_CONTENT`
    `static int` | `PARTICLE_CHOICE_UNBOUNDED`
    `static int` | `PARTICLE_SEQUENCE`
    `static int` | `SIMPLE_TYPE_SIMPLE_CONTENT`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Type()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAllEnumerationsFrom(Type from)`
    `void` | `addAttribute(Attribute attribute)`
    `void` | `addElement(Element element)`
    `void` | `addEnumerationValue(String enumerationValue, XmlCursor xc)`
    `void` | `closeEnumeration()`
    `static Type` | `createNamedType(QName name, int contentType)`
    `static Type` | `createUnnamedType(int contentType)`
    `Attribute` | `getAttribute(QName name)`
    `List<Attribute>` | `getAttributes()`
    `int` | `getContentType()`
    `List<Element>` | `getElements()`
    `List<QName>` | `getEnumerationQNames()`
    `List<String>` | `getEnumerationValues()`
    `Type` | `getExtensionType()`
    `QName` | `getName()`
    `int` | `getTopParticleForComplexOrMixedContent()`
    `boolean` | `hasSimpleContent()`
    `boolean` | `isComplexType()`
    `boolean` | `isEnumeration()`
    `boolean` | `isGlobal()`
    `boolean` | `isQNameEnumeration()`
    `void` | `setContentType(int kind)`
    `void` | `setElements(List<Element> elements)`
    `void` | `setExtensionType(Type extendedType)`
    `void` | `setGlobal(boolean isGlobal)`
    `void` | `setName(QName name)`
    `void` | `setTopParticleForComplexOrMixedContent(int topParticleForComplexOrMixedContent)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SIMPLE_TYPE_SIMPLE_CONTENT

          public static final int SIMPLE_TYPE_SIMPLE_CONTENT

      See Also:
        Constant Field Values

    - #### COMPLEX_TYPE_SIMPLE_CONTENT

          public static final int COMPLEX_TYPE_SIMPLE_CONTENT

      See Also:
        Constant Field Values

    - #### COMPLEX_TYPE_COMPLEX_CONTENT

          public static final int COMPLEX_TYPE_COMPLEX_CONTENT

      See Also:
        Constant Field Values

    - #### COMPLEX_TYPE_MIXED_CONTENT

          public static final int COMPLEX_TYPE_MIXED_CONTENT

      See Also:
        Constant Field Values

    - #### COMPLEX_TYPE_EMPTY_CONTENT

          public static final int COMPLEX_TYPE_EMPTY_CONTENT

      See Also:
        Constant Field Values

    - #### PARTICLE_SEQUENCE

          public static final int PARTICLE_SEQUENCE

      See Also:
        Constant Field Values

    - #### PARTICLE_CHOICE_UNBOUNDED

          public static final int PARTICLE_CHOICE_UNBOUNDED

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Type

          protected Type()

  - ### Method Detail

    - #### createNamedType

          public static Type createNamedType(QName name,
                                             int contentType)

    - #### createUnnamedType

          public static Type createUnnamedType(int contentType)

    - #### getName

          public QName getName()

    - #### setName

          public void setName(QName name)

    - #### getContentType

          public int getContentType()

      Returns:
        SIMPLE_TYPE_SIMPLE_CONTENT // ie no atts, no elems, just text COMPLEX_TYPE_SIMPLE_CONTENT // ie atts*, no elems, text* - simple type extension COMPLEX_TYPE_COMPLEX_CONTENT // ie atts*, elems, no text COMPLEX_TYPE_MIXED_CONTENT // ie atts*, elems, text COMPLEX_TYPE_EMPTY_CONTENT // no elems, no text, just atts

    - #### setContentType

          public void setContentType(int kind)

      Parameters:
        `kind` - 4 kinds: SIMPLE_TYPE_SIMPLE_CONTENT // ie no atts, no elems, just text COMPLEX_TYPE_SIMPLE_CONTENT // ie atts*, no elems, text* - simple type extension COMPLEX_TYPE_COMPLEX_CONTENT // ie atts*, elems, no text COMPLEX_TYPE_MIXED_CONTENT // ie atts*, elems, text COMPLEX_TYPE_EMPTY_CONTENT // no elems, no text, just atts

    - #### getElements

          public List<Element> getElements()

    - #### addElement

          public void addElement(Element element)

    - #### setElements

          public void setElements(List<Element> elements)

    - #### getAttributes

          public List<Attribute> getAttributes()

    - #### addAttribute

          public void addAttribute(Attribute attribute)

    - #### getAttribute

          public Attribute getAttribute(QName name)

    - #### isComplexType

          public boolean isComplexType()

    - #### hasSimpleContent

          public boolean hasSimpleContent()

    - #### getTopParticleForComplexOrMixedContent

          public int getTopParticleForComplexOrMixedContent()

      Returns:
        PARTICLE_SEQUENCE or PARTICLE_CHOICE_UNBOUNDED

    - #### setTopParticleForComplexOrMixedContent

          public void setTopParticleForComplexOrMixedContent(int topParticleForComplexOrMixedContent)

      Parameters:
        `topParticleForComplexOrMixedContent` - PARTICLE_SEQUENCE or PARTICLE_CHOICE_UNBOUNDED

    - #### isGlobal

          public boolean isGlobal()

    - #### setGlobal

          public void setGlobal(boolean isGlobal)

    - #### getExtensionType

          public Type getExtensionType()

    - #### setExtensionType

          public void setExtensionType(Type extendedType)

    - #### getEnumerationValues

          public List<String> getEnumerationValues()

    - #### getEnumerationQNames

          public List<QName> getEnumerationQNames()

    - #### addEnumerationValue

          public void addEnumerationValue(String enumerationValue,
                                          XmlCursor xc)

    - #### isEnumeration

          public boolean isEnumeration()

    - #### isQNameEnumeration

          public boolean isQNameEnumeration()

    - #### closeEnumeration

          public void closeEnumeration()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### addAllEnumerationsFrom

          public void addAllEnumerationsFrom(Type from)