Class CmsType

java.lang.Object
org.opencms.acacia.shared.CmsType
All Implemented Interfaces:
Serializable

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

See Also:
  • Field Details

  • Constructor Details

    • CmsType

      public CmsType(String id)
      Constructor.

      Parameters:
      id - the type id/name
    • CmsType

      protected CmsType()
      Constructor. For serialization only.

  • Method Details

    • addAttribute

      public void addAttribute(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(String attributeName)
      Returns the maximum occurrence of the given attribute.

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

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

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

      The names of the attributes of this type.

      Returns:
      the attribute names
    • getAttributeType

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

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

      public String getAttributeTypeName(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 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