Class List Method List File List

# Class: Vertx::JsonPointerIterator

Inherits:
  Object
  - Object
  - Vertx::JsonPointerIterator
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb

## Overview

The JsonPointerIterator is used by the read/write algorithms of the JsonPointer to read/write the querying data structure
Every method takes the currentValue as parameter, representing the actual value held by the query algorithm.
Implementations of this interface should be stateless, so they can be reused
You can implement this interface to query the structure you want using json pointers

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) JSON_ITERATOR
  Instance of a JsonPointerIterator to query Vert.x Json structures.
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (true, false) append_array_element?(currentValue = nil, value = nil)
  Append array element.
- - (true, false) array?(currentValue = nil)
  true if the current value is a queryable array.
- - (Object) get_array_element(currentValue = nil, i = nil)
  Move the iterator the the array element at specified index.
- - (Object) get_object_parameter(currentValue = nil, key = nil, createOnMissing = nil)
  Returns the object parameter with specified key.
- - (true, false) null?(currentValue = nil)
  true if the current value is null/empty.
- - (true, false) object?(currentValue = nil)
  true if the current value is a queryable object.
- - (true, false) object_contains_key?(currentValue = nil, key = nil)
  true if current value is a queryable object that contains the specified key.
- - (true, false) write_array_element?(currentValue = nil, i = nil, value = nil)
  Write array element at specified index.
- - (true, false) write_object_parameter?(currentValue = nil, key = nil, value = nil)
  Write object parameter at specified key.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    23
    24
    25
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 23

    def @@j_api_type.accept?(obj)
      obj.class == JsonPointerIterator
    end

### + (`Object`) j_api_type

    32
    33
    34
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 32

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    35
    36
    37
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 35

    def self.j_class
      Java::IoVertxCoreJsonPointer::JsonPointerIterator.java_class
    end

### + (`Object`) JSON_ITERATOR

Instance of a JsonPointerIterator to query Vert.x Json structures

    125
    126
    127
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 125

    def self.JSON_ITERATOR
      ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreJsonPointer::JsonPointerIterator.JSON_ITERATOR,::Vertx::JsonPointerIterator)
    end

### + (`Object`) unwrap(obj)

    29
    30
    31
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 29

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    26
    27
    28
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 26

    def @@j_api_type.wrap(obj)
      JsonPointerIterator.new(obj)
    end

## Instance Method Details

### - (`true`, `false`) append_array_element?(currentValue = nil, value = nil)

Append array element

Parameters:

- currentValue (`Object`) (defaults to: `nil`)
- value (`Object`) (defaults to: `nil`)

Returns:

- (`true`, `false`) —
  true if the operation is successful

Raises:

- (`ArgumentError`)

    118
    119
    120
    121
    122
    123
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 118

    def append_array_element?(currentValue=nil,value=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && ::Vertx::Util::unknown_type.accept?(value) && !block_given?
        return @j_del.java_method(:appendArrayElement, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(currentValue),::Vertx::Util::Utils.to_object(value))
      end
      raise ArgumentError, "Invalid arguments when calling append_array_element?(#{currentValue},#{value})"
    end

### - (`true`, `false`) array?(currentValue = nil)

Returns `true` if the current value is a queryable array

Parameters:

- currentValue (`Object`) (defaults to: `nil`)

Returns:

- (`true`, `false`) —
  `true` if the current value is a queryable array

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 48

    def array?(currentValue=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && !block_given?
        return @j_del.java_method(:isArray, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(currentValue))
      end
      raise ArgumentError, "Invalid arguments when calling array?(#{currentValue})"
    end

### - (`Object`) get_array_element(currentValue = nil, i = nil)

Move the iterator the the array element at specified index

Parameters:

- currentValue (`Object`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`) —
  array index

Returns:

- (`Object`) —
  the request array element, or null if the method was not able to find it

Raises:

- (`ArgumentError`)

    86
    87
    88
    89
    90
    91
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 86

    def get_array_element(currentValue=nil,i=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && i.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getArrayElement, [Java::java.lang.Object.java_class,Java::int.java_class]).call(::Vertx::Util::Utils.to_object(currentValue),i))
      end
      raise ArgumentError, "Invalid arguments when calling get_array_element(#{currentValue},#{i})"
    end

### - (`Object`) get_object_parameter(currentValue = nil, key = nil, createOnMissing = nil)

Returns the object parameter with specified key.

Parameters:

- currentValue (`Object`) (defaults to: `nil`)
- key (`String`) (defaults to: `nil`) —
  object key
- createOnMissing (`true`, `false`) (defaults to: `nil`) —
  If the current value is an object that doesn't contain the key, put an empty object at provided key

Returns:

- (`Object`) —
  the requested object parameter, or null if the method was not able to find it

Raises:

- (`ArgumentError`)

    76
    77
    78
    79
    80
    81
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 76

    def get_object_parameter(currentValue=nil,key=nil,createOnMissing=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && key.class == String && (createOnMissing.class == TrueClass || createOnMissing.class == FalseClass) && !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getObjectParameter, [Java::java.lang.Object.java_class,Java::java.lang.String.java_class,Java::boolean.java_class]).call(::Vertx::Util::Utils.to_object(currentValue),key,createOnMissing))
      end
      raise ArgumentError, "Invalid arguments when calling get_object_parameter(#{currentValue},#{key},#{createOnMissing})"
    end

### - (`true`, `false`) null?(currentValue = nil)

Returns `true` if the current value is null/empty

Parameters:

- currentValue (`Object`) (defaults to: `nil`)

Returns:

- (`true`, `false`) —
  `true` if the current value is null/empty

Raises:

- (`ArgumentError`)

    56
    57
    58
    59
    60
    61
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 56

    def null?(currentValue=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && !block_given?
        return @j_del.java_method(:isNull, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(currentValue))
      end
      raise ArgumentError, "Invalid arguments when calling null?(#{currentValue})"
    end

### - (`true`, `false`) object?(currentValue = nil)

Returns `true` if the current value is a queryable object

Parameters:

- currentValue (`Object`) (defaults to: `nil`)

Returns:

- (`true`, `false`) —
  `true` if the current value is a queryable object

Raises:

- (`ArgumentError`)

    40
    41
    42
    43
    44
    45
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 40

    def object?(currentValue=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && !block_given?
        return @j_del.java_method(:isObject, [Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(currentValue))
      end
      raise ArgumentError, "Invalid arguments when calling object?(#{currentValue})"
    end

### - (`true`, `false`) object_contains_key?(currentValue = nil, key = nil)

Returns `true` if current value is a queryable object that contains the specified key

Parameters:

- currentValue (`Object`) (defaults to: `nil`)
- key (`String`) (defaults to: `nil`) —
  object key

Returns:

- (`true`, `false`) —
  `true` if current value is a queryable object that contains the specified key

Raises:

- (`ArgumentError`)

    65
    66
    67
    68
    69
    70
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 65

    def object_contains_key?(currentValue=nil,key=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && key.class == String && !block_given?
        return @j_del.java_method(:objectContainsKey, [Java::java.lang.Object.java_class,Java::java.lang.String.java_class]).call(::Vertx::Util::Utils.to_object(currentValue),key)
      end
      raise ArgumentError, "Invalid arguments when calling object_contains_key?(#{currentValue},#{key})"
    end

### - (`true`, `false`) write_array_element?(currentValue = nil, i = nil, value = nil)

Write array element at specified index

Parameters:

- currentValue (`Object`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`)
- value (`Object`) (defaults to: `nil`)

Returns:

- (`true`, `false`) —
  true if the operation is successful

Raises:

- (`ArgumentError`)

    108
    109
    110
    111
    112
    113
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 108

    def write_array_element?(currentValue=nil,i=nil,value=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && i.class == Fixnum && ::Vertx::Util::unknown_type.accept?(value) && !block_given?
        return @j_del.java_method(:writeArrayElement, [Java::java.lang.Object.java_class,Java::int.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(currentValue),i,::Vertx::Util::Utils.to_object(value))
      end
      raise ArgumentError, "Invalid arguments when calling write_array_element?(#{currentValue},#{i},#{value})"
    end

### - (`true`, `false`) write_object_parameter?(currentValue = nil, key = nil, value = nil)

Write object parameter at specified key

Parameters:

- currentValue (`Object`) (defaults to: `nil`)
- key (`String`) (defaults to: `nil`)
- value (`Object`) (defaults to: `nil`)

Returns:

- (`true`, `false`) —
  true if the operation is successful

Raises:

- (`ArgumentError`)

    97
    98
    99
    100
    101
    102
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 97

    def write_object_parameter?(currentValue=nil,key=nil,value=nil)
      if ::Vertx::Util::unknown_type.accept?(currentValue) && key.class == String && ::Vertx::Util::unknown_type.accept?(value) && !block_given?
        return @j_del.java_method(:writeObjectParameter, [Java::java.lang.Object.java_class,Java::java.lang.String.java_class,Java::java.lang.Object.java_class]).call(::Vertx::Util::Utils.to_object(currentValue),key,::Vertx::Util::Utils.to_object(value))
      end
      raise ArgumentError, "Invalid arguments when calling write_object_parameter?(#{currentValue},#{key},#{value})"
    end