Class Value.ObjectValue

    • Constructor Detail

      • ObjectValue

        public ObjectValue()
    • Method Detail

      • valid

        public boolean valid()
        Description copied from interface: Inspector
        Check if the inspector is valid. If you try to access a field or array entry that does not exist, you will get an invalid Inspector returned.
        Specified by:
        valid in interface Inspector
        Overrides:
        valid in class Value
      • type

        public Type type()
        Description copied from interface: Inspector
        Get the type of an inspector
        Specified by:
        type in interface Inspector
        Overrides:
        type in class Value
      • fieldCount

        public int fieldCount()
        Description copied from interface: Inspector
        Get the number of fields in an OBJECT (always returns 0 for non-objects)
        Specified by:
        fieldCount in interface Inspector
        Overrides:
        fieldCount in class Value
      • field

        public Inspector field​(java.lang.String name)
        Description copied from interface: Inspector
        Access an field in an object. If the current Inspector doesn't connect to an object value, or the object value does not contain a field with the given symbol name, the returned Inspector will be invalid.
        Specified by:
        field in interface Inspector
        Overrides:
        field in class Value
        Parameters:
        name - symbol name
        Returns:
        a new Inspector for the field value
      • traverse

        public void traverse​(ObjectTraverser ot)
        Description copied from interface: Inspector
        Traverse an object value, performing callbacks for each field. If the current Inspector is connected to an object value, perform callbacks to the given traverser for each field contained in the object. Otherwise a no-op.
        Specified by:
        traverse in interface Inspector
        Overrides:
        traverse in class Value
        Parameters:
        ot - traverser callback object
      • fields

        public java.lang.Iterable<java.util.Map.Entry<java.lang.String,​Inspector>> fields()
        Description copied from interface: Inspector
        Convert an object to an iterable list of (name, value) pairs. Other types will just return an empty list.
        Specified by:
        fields in interface Inspector
        Overrides:
        fields in class Value
      • put

        public Value.ObjectValue put​(java.lang.String name,
                                     java.lang.String value)