Package ru.curs.celesta.score
Class NamedElement
java.lang.Object
ru.curs.celesta.score.NamedElement
- Direct Known Subclasses:
Column,Grain,GrainElement,Parameter
A named element of metamodel (e.g. table or column) that must have
a unique identifier name.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximal length of an identifier of Celesta. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns value of document string for this element.final StringgetName()Returns the name.final StringReturns the name in ANSI quotes (e.g.final StringReturns the name in ANSI quotes if needed.final inthashCode()static StringRestricts identifier length by maximal number of symbols.static StringRestricts identifier length with a postfix by maximal number of symbols.voidsetCelestaDoc(String celestaDoc) Sets value of document string.
-
Field Details
-
MAX_IDENTIFIER_LENGTH
public static final int MAX_IDENTIFIER_LENGTHThe maximal length of an identifier of Celesta.- See Also:
-
-
Constructor Details
-
NamedElement
- Throws:
ParseException
-
-
Method Details
-
limitName
Restricts identifier length by maximal number of symbols.- Parameters:
value- Identifier of arbitrary length.- Returns:
- "Shortcut" identifier that has a hash code of the original one as its last 8 symbols.
-
limitName
Restricts identifier length with a postfix by maximal number of symbols. The resulting form becomes: <restricted identifier><postfix>. For example my_very_long_table_name with _nextValueProc becomes - my_very_73FAF9A9_nextValueProc- Parameters:
value- Identifier of arbitrary length.postfix- Identifier postfix.- Returns:
- "Shortcut" identifier that has a hash code of the original one as its last 8 symbols plus postfix.
-
getName
Returns the name. -
getQuotedName
Returns the name in ANSI quotes (e.g. "celestaIdentifier"). -
getQuotedNameIfNeeded
Returns the name in ANSI quotes if needed.- Returns:
-
hashCode
public final int hashCode() -
equals
-
getCelestaDoc
Returns value of document string for this element.- Returns:
-
setCelestaDoc
Sets value of document string.- Parameters:
celestaDoc- new value- Throws:
ParseException- incorrect CelestaDoc
-