Package com.nomagic.magicdraw.properties
Class StringProperty
- java.lang.Object
-
- com.nomagic.magicdraw.properties.Property
-
- com.nomagic.magicdraw.properties.StringProperty
-
- All Implemented Interfaces:
PropertyVisitorAcceptor,java.lang.Cloneable
- Direct Known Subclasses:
DateTimeProperty,JarEntryProperty,PasswordProperty
@OpenApiAll public class StringProperty extends Property
The property for storing and editing some String value.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanmMultilineIs multiline string-
Fields inherited from class com.nomagic.magicdraw.properties.Property
DEFAULT_PROPERTY_RESOURCE_PROVIDER, EDITABLE, NULL, NULL_ID_PROPERTY_RESOURCE_PROVIDER, UNDEFINED, VALUE
-
-
Constructor Summary
Constructors Constructor Description StringProperty()Default constructor.StringProperty(java.lang.String id, java.lang.Object value)Deprecated.StringProperty(java.lang.String id, java.lang.Object value, boolean multiline)Deprecated.StringProperty(java.lang.String id, java.lang.String value)The property constructor.StringProperty(java.lang.String id, java.lang.String value, boolean multiline)The property constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(PropertyVisitor v)Accepts the given visitor.StringPropertyclone()Clones the property.private static java.lang.StringconvertValue(java.lang.String id, java.lang.Object value)java.lang.StringgetClassType()Returns property class type.java.lang.StringgetString()Returns value as String object.java.lang.StringgetValueStringRepresentation()Returns value's string representation.booleanisMultiline()Returns multiline flag.voidsetMultiline(boolean multiline)Sets the multiline flagvoidsetValue(java.lang.Object value)Sets new property value.-
Methods inherited from class com.nomagic.magicdraw.properties.Property
_getValue, _isFrozen, _setFrozen, _setValue, addPropertyChangeListener, addSource, addSources, areEqualByValue, areValuesEqual, checkFrozen, checkFrozen, createCellEditor, createTableCellRenderer, equals, firePropertyChange, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, getSourceAsElement, getSources, getSourcesAsStream, getUndefinedString, getUndefinedString, getValue, hashCode, isEditable, isUndefinedState, isValueCompatible, removePropertyChangeListener, setAdditionalProperties, setAdditionalProperty, setDescription, setDescriptionID, setEditable, setGroup, setID, setIntroductoryVersion, setNonEditableReason, setResourceProvider, setResourceProviderID, setSources, setUndefinedState, toString
-
-
-
-
Constructor Detail
-
StringProperty
public StringProperty()
Default constructor. Value of the property will be null. ID will be empty string. Property is editable.
-
StringProperty
@Deprecated public StringProperty(java.lang.String id, @CheckForNull java.lang.Object value)Deprecated.
-
StringProperty
public StringProperty(java.lang.String id, @CheckForNull java.lang.String value)The property constructor. Property is editable, and not multi lined.- Parameters:
id- the ID of property.value- value of the property.
-
StringProperty
@Deprecated public StringProperty(java.lang.String id, @CheckForNull java.lang.Object value, boolean multiline)Deprecated.
-
StringProperty
public StringProperty(java.lang.String id, @CheckForNull java.lang.String value, boolean multiline)The property constructor. Property is editable.- Parameters:
id- the ID of property.value- value of the property.multiline- the multiline flag value.
-
-
Method Detail
-
setValue
public void setValue(@CheckForNull java.lang.Object value)Description copied from class:PropertySets new property value. Will fire aPropertyChangeEventwith propertyName - property ID, newValue and oldValue.
-
convertValue
@CheckForNull private static java.lang.String convertValue(java.lang.String id, @CheckForNull java.lang.Object value)
-
isMultiline
public boolean isMultiline()
Returns multiline flag.- Returns:
- the multiline flag.
-
setMultiline
public void setMultiline(boolean multiline)
Sets the multiline flag- Parameters:
multiline- the multiline flag value.
-
getValueStringRepresentation
public java.lang.String getValueStringRepresentation()
Returns value's string representation.- Overrides:
getValueStringRepresentationin classProperty- Returns:
- string value.
-
accept
public void accept(PropertyVisitor v) throws java.lang.Exception
Accepts the given visitor.- Specified by:
acceptin interfacePropertyVisitorAcceptor- Overrides:
acceptin classProperty- Parameters:
v- the PropertyVisitor.- Throws:
java.lang.Exception
-
getString
public java.lang.String getString()
Returns value as String object.- Returns:
- String object.
-
getClassType
public java.lang.String getClassType()
Returns property class type.- Specified by:
getClassTypein interfacePropertyVisitorAcceptor- Overrides:
getClassTypein classProperty- Returns:
- PropertyID.STRING_PROPERTY
- See Also:
PropertyID.STRING_PROPERTY
-
clone
public StringProperty clone()
Description copied from class:PropertyClones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
-
-