Class AttributeDeclaration
- java.lang.Object
-
- org.eclipse.lemminx.extensions.generators.AttributeDeclaration
-
public class AttributeDeclaration extends Object
Attribute declaration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttributeDeclaration.DataType
-
Constructor Summary
Constructors Constructor Description AttributeDeclaration(String name, ElementDeclaration ownerElementDecl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(String value)AttributeDeclaration.DataTypegetDataType()Returns the attribute data type.StringgetName()Returns the attribute name.intgetOccurrences()Returns the occurrences of DOM attribute.SortedSet<String>getValues()Returns the all distinct attribute values.voidincrementOccurrences()Increment the DOM attributes occurrence.booleanisAllNames()booleanisAllNMTOKENs()booleanisEnums(FileContentGeneratorSettings settings)Returns true if attributes have values enumeration and false otherwise.booleanisFixedValue(FileContentGeneratorSettings settings)Returns true if all values of the attribute are fixed with a given value and false otherwise.booleanisID(FileContentGeneratorSettings settings)Returns true if the attribute is an ID and false otherwise.booleanisRequired()Returns true if the attribute declaration is required and false otherwise.booleanisUnique()
-
-
-
Constructor Detail
-
AttributeDeclaration
public AttributeDeclaration(String name, ElementDeclaration ownerElementDecl)
-
-
Method Detail
-
getName
public String getName()
Returns the attribute name.- Returns:
- the attribute name.
-
incrementOccurrences
public void incrementOccurrences()
Increment the DOM attributes occurrence.
-
addValue
public void addValue(String value)
-
getOccurrences
public int getOccurrences()
Returns the occurrences of DOM attribute.- Returns:
- the occurrences of DOM attribute.
-
isID
public boolean isID(FileContentGeneratorSettings settings)
Returns true if the attribute is an ID and false otherwise.- Parameters:
settings- the generator settings.- Returns:
- true if the attribute is an ID and false otherwise.
-
isRequired
public boolean isRequired()
Returns true if the attribute declaration is required and false otherwise.- Returns:
- true if the attribute declaration is required and false otherwise.
-
isUnique
public boolean isUnique()
-
isAllNames
public boolean isAllNames()
-
isAllNMTOKENs
public boolean isAllNMTOKENs()
-
getValues
public SortedSet<String> getValues()
Returns the all distinct attribute values.- Returns:
- the all distinct attribute values.
-
isFixedValue
public boolean isFixedValue(FileContentGeneratorSettings settings)
Returns true if all values of the attribute are fixed with a given value and false otherwise.- Parameters:
settings- the generator settings.- Returns:
- true if all values of the attribute are fixed with a given value and false otherwise.
-
isEnums
public boolean isEnums(FileContentGeneratorSettings settings)
Returns true if attributes have values enumeration and false otherwise.- Parameters:
settings- the generator settings.- Returns:
- true if attributes have values enumeration and false otherwise.
-
getDataType
public AttributeDeclaration.DataType getDataType()
Returns the attribute data type.- Returns:
- the attribute data type.
-
-