Interface XMLCardinality

All Superinterfaces:
XMLUsage
All Known Implementing Classes:
XMLCardinality.Single, XMLCardinality.Unbounded

public interface XMLCardinality extends XMLUsage
Defines the cardinality of an XML particle.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Cardinalities for single particles.
    static enum 
    Common cardinalities for unbounded particles.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final XMLCardinality
    Cardinality of a disabled particle.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the maximum number of occurrences of this particle.
    int
    Returns the minimum number of occurrences of this particle.
    default boolean
    Indicates whether or not the associated particle may occur at all, i.e. maxOccurs > 0
    default boolean
    Indicates whether or not the associated particle can occur more than once, i.e. maxOccurs > 1
    default boolean
    Indicates whether or not the associated particle must occur, i.e. minOccurs > 0
    of(int minOccurs, OptionalInt maxOccurs)
    Creates an XML cardinality with the specified minOccurs and maxOccurs that describes the number of permissible occurrences of a given XML particle.
    static String
    toString(XMLCardinality cardinality)
     
  • Field Details

    • DISABLED

      static final XMLCardinality DISABLED
      Cardinality of a disabled particle.
  • Method Details

    • getMinOccurs

      int getMinOccurs()
      Returns the minimum number of occurrences of this particle.
      Returns:
      the minimum number of occurrences of this particle.
    • getMaxOccurs

      OptionalInt getMaxOccurs()
      Returns the maximum number of occurrences of this particle.
      Returns:
      the maximum number of occurrences of this particle.
    • isRequired

      default boolean isRequired()
      Indicates whether or not the associated particle must occur, i.e. minOccurs > 0
      Specified by:
      isRequired in interface XMLUsage
      Returns:
      true, if the associated particle is required, false otherwise
    • isRepeatable

      default boolean isRepeatable()
      Indicates whether or not the associated particle can occur more than once, i.e. maxOccurs > 1
      Returns:
      true, if the associated particle is repeatable, false otherwise
    • isEnabled

      default boolean isEnabled()
      Indicates whether or not the associated particle may occur at all, i.e. maxOccurs > 0
      Specified by:
      isEnabled in interface XMLUsage
      Returns:
      true, if the associated particle is enabled, false otherwise
    • of

      static XMLCardinality of(int minOccurs, OptionalInt maxOccurs)
      Creates an XML cardinality with the specified minOccurs and maxOccurs that describes the number of permissible occurrences of a given XML particle.
      Parameters:
      minOccurs - the minimum permissible occurrences of the associated particle
      maxOccurs - when present, the maximum permissible occurrences of the associated particle, otherwise unbounded
      Returns:
      an XML cardinality
    • toString

      static String toString(XMLCardinality cardinality)