Class MObjectProp

java.lang.Object
chemaxon.struc.MProp
chemaxon.struc.prop.MObjectProp
All Implemented Interfaces:
Serializable, Cloneable

@PublicApi public class MObjectProp extends MProp
Property that stores any object. It is imported and exported using serialization and base64 encoding.

For security reasons, only chemical structure classes and basic JDK value and collection classes are deserialized when the property is imported from string. Other classes are rejected.

Since:
Marvin 4.1, 11/20/2005
See Also:
  • Constructor Details

    • MObjectProp

      public MObjectProp(Object o)
      Constructs a property object.
      Parameters:
      o - the object
    • MObjectProp

      public MObjectProp(String sval) throws IOException
      Constructs a property from a string value.
      Parameters:
      sval - the string value
      Throws:
      IOException - if the value cannot be deserialized or contains a class that is not allowed
  • Method Details

    • getPropValue

      public Object getPropValue()
      Gets the property value as an object.
      Specified by:
      getPropValue in class MProp
      Returns:
      the object
    • getPropType

      public String getPropType()
      Gets the type name of the property.
      Specified by:
      getPropType in class MProp
      Returns:
      "object"
    • getPropXSDType

      public String getPropXSDType()
      Gets the XSD type name of the property.
      Specified by:
      getPropXSDType in class MProp
      Returns:
      "ENTITY"
    • cloneProp

      public MObjectProp cloneProp()
      Clones the object.
      Specified by:
      cloneProp in class MProp
      Returns:
      the clone
    • clone

      public MObjectProp clone()
      Clones the object.
      Overrides:
      clone in class Object
      Returns:
      the clone
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Create the serialized object base64 string representation.
      Overrides:
      toString in class MProp
      Returns:
      a string representation of this object
      Throws:
      IllegalArgumentException - if serialization or base64 encoding fails.
      Since:
      Marvin 5.7, 07/25/2011