Package org.opencms.acacia.shared
Class CmsType
- java.lang.Object
-
- org.opencms.acacia.shared.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.
-
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.
-
-
-
Field Detail
-
CHOICE_ATTRIBUTE_NAME
public static final java.lang.String CHOICE_ATTRIBUTE_NAME
The choice attribute name.- See Also:
- Constant Field Values
-
-
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 nameattributeType
- the attribute typeminOccurrence
- the minimum occurrence of this attributemaxOccurrence
- 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
-
-