Class: Vertx::JsonPointerIterator

Inherits:
Object
  • Object
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)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) JSON_ITERATOR

Instance of a JsonPointerIterator to query Vert.x Json structures


171
172
173
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 171

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (true, false) appendArrayElement(currentValue, value)

Append array element

Parameters:

  • currentValue (Object)
  • value (Object)

Returns:

  • (true, false)
    true if the operation is successful


145
146
147
148
149
150
151
152
153
154
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 145

def append_array_element?(*args)
  if ::Vertx::Util::unknown_type.accept?(args[0]) && ::Vertx::Util::unknown_type.accept?(args[1]) && !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(args[0]),::Vertx::Util::Utils.to_object(args[1]))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling append_array_element?(#{args[0]},#{args[1]})"
  end
end

- (true, false) isArray(currentValue)

Returns true if the current value is a queryable array

Parameters:

  • currentValue (Object)

Returns:

  • (true, false)
    true if the current value is a queryable array


114
115
116
117
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 114

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

- (Object) getArrayElement(currentValue, i)

Move the iterator the the array element at specified index

Parameters:

  • currentValue (Object)
  • i (Fixnum)
    array index

Returns:

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


160
161
162
163
164
165
166
167
168
169
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 160

def get_array_element(*args)
  if ::Vertx::Util::unknown_type.accept?(args[0]) && args[1].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(args[0]),args[1]))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling get_array_element(#{args[0]},#{args[1]})"
  end
end

- (Object) getObjectParameter(currentValue, key, createOnMissing)

Returns the object parameter with specified key.

Parameters:

  • currentValue (Object)
  • key (String)
    object key
  • createOnMissing (true, false)
    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


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

def get_object_parameter(*args)
  if ::Vertx::Util::unknown_type.accept?(args[0]) && args[1].class == String && (args[2].class == TrueClass || args[2].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(args[0]),args[1],args[2]))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling get_object_parameter(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (true, false) isNull(currentValue)

Returns true if the current value is null/empty

Parameters:

  • currentValue (Object)

Returns:

  • (true, false)
    true if the current value is null/empty


69
70
71
72
73
74
75
76
77
78
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 69

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

- (true, false) isObject(currentValue)

Returns true if the current value is a queryable object

Parameters:

  • currentValue (Object)

Returns:

  • (true, false)
    true if the current value is a queryable object


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

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

- (true, false) objectContainsKey(currentValue, key)

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

Parameters:

  • currentValue (Object)
  • key (String)
    object key

Returns:

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


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

def object_contains_key?(*args)
  if ::Vertx::Util::unknown_type.accept?(args[0]) && args[1].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(args[0]),args[1])
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling object_contains_key?(#{args[0]},#{args[1]})"
  end
end

- (true, false) writeArrayElement(currentValue, i, value)

Write array element at specified index

Parameters:

  • currentValue (Object)
  • i (Fixnum)
  • value (Object)

Returns:

  • (true, false)
    true if the operation is successful


130
131
132
133
134
135
136
137
138
139
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 130

def write_array_element?(*args)
  if ::Vertx::Util::unknown_type.accept?(args[0]) && args[1].class == Fixnum && ::Vertx::Util::unknown_type.accept?(args[2]) && !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(args[0]),args[1],::Vertx::Util::Utils.to_object(args[2]))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling write_array_element?(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (true, false) writeObjectParameter(currentValue, key, value)

Write object parameter at specified key

Parameters:

  • currentValue (Object)
  • key (String)
  • value (Object)

Returns:

  • (true, false)
    true if the operation is successful


101
102
103
104
105
106
107
108
109
110
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/json_pointer_iterator.rb', line 101

def write_object_parameter?(*args)
  if ::Vertx::Util::unknown_type.accept?(args[0]) && args[1].class == String && ::Vertx::Util::unknown_type.accept?(args[2]) && !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(args[0]),args[1],::Vertx::Util::Utils.to_object(args[2]))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling write_object_parameter?(#{args[0]},#{args[1]},#{args[2]})"
  end
end