class WsdlMapper::DomParsing::ParserBase

Protected Instance Methods

parse_annotation(node, type) click to toggle source
# File lib/wsdl_mapper/dom_parsing/parser_base.rb, line 16
def parse_annotation(node, type)
  type.documentation = @base.parsers[ANNOTATION].parse node
end
parse_base(node, type) click to toggle source
# File lib/wsdl_mapper/dom_parsing/parser_base.rb, line 12
def parse_base(node, type)
  type.base_type_name = parse_name_in_attribute 'base', node
end
parse_bounds(node, container) click to toggle source
# File lib/wsdl_mapper/dom_parsing/parser_base.rb, line 20
def parse_bounds(node, container)
  bounds = DEFAULT_BOUNDS[container].dup

  if bounds.nil?
    raise ArgumentError.new("Unknown container #{container}")
  end

  if node.attributes.has_key? 'minOccurs'
    bounds.min = node.attributes['minOccurs'].value.to_i
  end

  if node.attributes.has_key? 'maxOccurs'
    max = node.attributes['maxOccurs'].value
    bounds.max = max == 'unbounded' ? nil : max.to_i
  end

  bounds
end