Interface ComplexType

    • Method Detail

      • getField

        Field getField​(String name)
        Gets the field with the given name.

        If the name is non-prefixed the first matching field is returned if any is found. If the name is prefixed then the right field is returned if any is found.

        name - the field name
        the field
      • getField

        Field getField​(QName name)
        Gets the field having the given name.
        name - the name
        the field or null if no field with that name was found
      • addField

        Field addField​(String name,
                       Type type,
                       String defaultValue,
                       int flags,
                       Collection<Constraint> constraints)
        Adds a field to this complex type.

        If the given name is not prefixed it will be prefixed with the type prefix. If one was specified otherwise the default prefix will be used (e.g. "" - no prefix). If the given name is prefixed it will be stored as is (using the specified prefix).

        name - the field name
        type - the field type
        defaultValue - an optional default value (null if none)
        flags - optional flags
        the created field
      • hasField

        boolean hasField​(String name)
        Tests whether this type defines the given field name.

        The name is supposed to be non prefixed.

        name - the field name
        true if the field exists, false otherwise
      • hasFields

        boolean hasFields()
        Tests whether this type has any field defined.

        If a complex type has no fields, it is considered as unstructured and it accepts any field with any type and name.

        true if the at least one field exists, false otherwise
      • getFieldsCount

        int getFieldsCount()
        Gets the number of fields defined for this complex type.
        the fields count