Class CmsType

  • All Implemented Interfaces:
    java.io.Serializable

    public class CmsType
    extends java.lang.Object
    implements java.io.Serializable
    CmsEntity attribute type data.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CHOICE_ATTRIBUTE_NAME
      The choice attribute name.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CmsType()
      Constructor.
        CmsType​(java.lang.String id)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAttribute​(java.lang.String attributeName, CmsType attributeType, int minOccurrence, int maxOccurrence)
      Adds an attribute to the type.
      int getAttributeMaxOccurrence​(java.lang.String attributeName)
      Returns the maximum occurrence of the given attribute.
      int getAttributeMinOccurrence​(java.lang.String attributeName)
      Returns the minimum occurrence of the given attribute.
      java.util.List<java.lang.String> getAttributeNames()
      The names of the attributes of this type.
      CmsType getAttributeType​(java.lang.String attributeName)
      Returns the type of the given attribute.
      java.lang.String getAttributeTypeName​(java.lang.String attributeName)
      Returns the type name of the given attribute.
      int getChoiceMaxOccurrence()
      Returns the maximum choice occurrence.
      java.lang.String getId()
      Returns the name of the type.
      boolean isChoice()
      Returns if this is a choice type.
      boolean isSimpleType()
      Returns if this is a simple type.
      void setChoiceMaxOccurrence​(int choiceMaxOccurrence)
      Sets the maximum choice occurrence.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CmsType

        public CmsType​(java.lang.String id)
        Constructor.

        Parameters:
        id - the type id/name
      • CmsType

        protected CmsType()
        Constructor. For serialization only.

    • Method Detail

      • addAttribute

        public void addAttribute​(java.lang.String attributeName,
                                 CmsType attributeType,
                                 int minOccurrence,
                                 int maxOccurrence)
        Adds an attribute to the type.

        Parameters:
        attributeName - the attribute name
        attributeType - the attribute type
        minOccurrence - the minimum occurrence of this attribute
        maxOccurrence - the axnimum occurrence of this attribute
      • getAttributeMaxOccurrence

        public int getAttributeMaxOccurrence​(java.lang.String attributeName)
        Returns the maximum occurrence of the given attribute.

        Parameters:
        attributeName - the attribute name
        Returns:
        the maximum occurrence
      • getAttributeMinOccurrence

        public int getAttributeMinOccurrence​(java.lang.String attributeName)
        Returns the minimum occurrence of the given attribute.

        Parameters:
        attributeName - the attribute name
        Returns:
        the minimum occurrence
      • getAttributeNames

        public java.util.List<java.lang.String> getAttributeNames()
        The names of the attributes of this type.

        Returns:
        the attribute names
      • getAttributeType

        public CmsType getAttributeType​(java.lang.String attributeName)
        Returns the type of the given attribute.

        Parameters:
        attributeName - the attribute name
        Returns:
        the type of the given attribute
      • getAttributeTypeName

        public java.lang.String getAttributeTypeName​(java.lang.String attributeName)
        Returns the type name of the given attribute.

        Parameters:
        attributeName - the attribute name
        Returns:
        the type name of the given attribute
      • getChoiceMaxOccurrence

        public int getChoiceMaxOccurrence()
        Returns the maximum choice occurrence.

        Returns:
        the maximum choice occurrence
      • getId

        public java.lang.String getId()
        Returns the name of the type.

        Returns:
        the name of the type
      • isChoice

        public boolean isChoice()
        Returns if this is a choice type.

        Returns:
        true if this is a choice type
      • isSimpleType

        public boolean isSimpleType()
        Returns if this is a simple type. Simple types have no attributes.

        Returns:
        true if this is a simple type
      • setChoiceMaxOccurrence

        public void setChoiceMaxOccurrence​(int choiceMaxOccurrence)
        Sets the maximum choice occurrence.

        Parameters:
        choiceMaxOccurrence - the maximum choice occurrence