Class Property

  • Direct Known Subclasses:
    PropertyImpl

    public abstract class Property
    extends java.lang.Object
    Property objects represent the mapping between low-level stores and high-level data. The simplest Property could be nothing more than a map of one index to one property's value, but abstracting the interface allows for getter/setter methods, type-checked properties, and other such specialized and language-specific behavior. ECMAScript[8.6.1]
    • Constructor Detail

      • Property

        protected Property()
    • Method Detail

      • create

        public static Property create​(java.lang.Object key,
                                      Location location,
                                      int flags)
      • getKey

        public abstract java.lang.Object getKey()
        Get property identifier.
      • getFlags

        public abstract int getFlags()
        Get property flags.
      • relocate

        public abstract Property relocate​(Location newLocation)
        Change the property's location.
        Returns:
        a Property with the new location (or this if the location is unchanged).
      • get

        public abstract java.lang.Object get​(DynamicObject store,
                                             Shape shape)
        Gets the value of this property of the object.
        Parameters:
        store - the store that this property resides in
        shape - the current shape of the object, which must contain this location
        See Also:
        DynamicObject.get(Object, Object)
      • setGeneric

        public abstract void setGeneric​(DynamicObject store,
                                        java.lang.Object value,
                                        Shape shape)
        Assigns value to this property of the object. Automatically relocates the property if the value cannot be assigned to its current location.
        Parameters:
        shape - the current shape of the object or null
      • isSame

        public abstract boolean isSame​(Property other)
        Returns true if this property and some other property have the same key and flags.
      • getLocation

        public abstract Location getLocation()
        Get the property location.
      • isHidden

        public abstract boolean isHidden()
        Is this property hidden from iteration.
        See Also:
        HiddenKey
      • isShadow

        public abstract boolean isShadow()
      • copyWithFlags

        public abstract Property copyWithFlags​(int newFlags)
        Create a copy of the property with the given flags.
      • copyWithRelocatable

        public abstract Property copyWithRelocatable​(boolean newRelocatable)