Class StringProperty

java.lang.Object
com.nomagic.magicdraw.properties.Property
com.nomagic.magicdraw.properties.StringProperty
All Implemented Interfaces:
PropertyVisitorAcceptor, Cloneable
Direct Known Subclasses:
DateTimeProperty, JarEntryProperty, PasswordProperty

@OpenApiAll public class StringProperty extends Property
The property for storing and editing some String value.
  • Constructor Details

    • StringProperty

      public StringProperty()
      Default constructor. Value of the property will be null. ID will be empty string. Property is editable.
    • StringProperty

      @Deprecated public StringProperty(String id, @CheckForNull Object value)
    • StringProperty

      public StringProperty(String id, @CheckForNull 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(String id, @CheckForNull Object value, boolean multiline)
    • StringProperty

      public StringProperty(String id, @CheckForNull 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 Details

    • setValue

      public void setValue(@CheckForNull Object value)
      Description copied from class: Property
      Sets new property value. Will fire a PropertyChangeEvent with propertyName - property ID, newValue and oldValue.
      Overrides:
      setValue in class Property
      Parameters:
      value - a new property 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 String getValueStringRepresentation()
      Returns value's string representation.
      Overrides:
      getValueStringRepresentation in class Property
      Returns:
      string value.
    • accept

      public void accept(PropertyVisitor v) throws Exception
      Accepts the given visitor.
      Specified by:
      accept in interface PropertyVisitorAcceptor
      Overrides:
      accept in class Property
      Parameters:
      v - the PropertyVisitor.
      Throws:
      Exception
    • getString

      public String getString()
      Returns value as String object.
      Returns:
      String object.
    • getClassType

      public String getClassType()
      Returns property class type.
      Specified by:
      getClassType in interface PropertyVisitorAcceptor
      Overrides:
      getClassType in class Property
      Returns:
      PropertyID.STRING_PROPERTY
      See Also:
    • clone

      public StringProperty clone()
      Description copied from class: Property
      Clones the property. Clone is not deep, the clone will have the same instance of value. The clone will not have registered PropertyChangeListeners.
      Overrides:
      clone in class Property
      Returns:
      the cloned property.