class Kilza::Java

Objective-C Language parser

Public Class Methods

new(json_string) click to toggle source
Calls superclass method Kilza::Language::new
# File lib/kilza/language/java.rb, line 28
def initialize(json_string)
  super(json_string)

  @reserved_words = %w(
    abstract continue for new switch assert default goto,
    package synchronized boolean do if private this break double implements,
    protected throw byte else import public throws case enum instanceof,
    null return transient catch extends int short try char final interface static,
    void class finally long strictfp volatile const float native super while
  )

  @types = {
    'nilclass' => 'Object',
    'string' => 'String',
    'fixnum' => 'Long',
    'float' => 'Double',
    'falseclass' => 'Boolean',
    'trueclass' => 'Boolean',
    'hash' => 'Object'
  }

  @equal_keys = %w(id identifier uid)
end

Public Instance Methods

classes(class_name) click to toggle source
Calls superclass method
# File lib/kilza/language/java.rb, line 56
def classes(class_name)
  super(class_name)

  @classes.each do |cl|
    cl.properties.each do |pr|
      pr.type = pr.name.capitalize if pr.object? || (pr.array? && pr.null?)

      cl.imports.push('import java.util.ArrayList;') if pr.array? &&
        cl.imports.index('import java.util.ArrayList;').nil?

      pr.type = @types[pr.type] unless @types[pr.type].nil?
    end
  end
end
clazz(name) click to toggle source
# File lib/kilza/language/java.rb, line 52
def clazz(name)
  Kilza::Java::Class.new(name)
end