Class: WSDL::XMLSchema::Group

Inherits:
ComplexType show all
Includes:
Ref
Defined in:
lib/wsdl/xmlSchema/group.rb

Instance Attribute Summary collapse

Attributes included from Ref

#ref

Attributes inherited from ComplexType

#abstract, #complexcontent, #content, #final, #mixed, #name, #simplecontent

Attributes inherited from Info

#id, #parent, #root

Instance Method Summary collapse

Methods included from Ref

included

Methods inherited from ComplexType

#all_elements=, #attributes, #base, #check_type, #child_defined_complextype, #child_type, #choice?, #compoundtype, #elements, #find_aryelement, #find_arytype, #find_element, #find_element_by_name, #find_soapenc_arytype, #have_any?, #nested_elements, #sequence_elements=

Methods inherited from Info

#inspect, #parse_epilogue

Constructor Details

#initialize(name = nil) ⇒ Group

Returns a new instance of Group.



30
31
32
33
34
35
36
37
38
# File 'lib/wsdl/xmlSchema/group.rb', line 30

def initialize(name = nil)
  super()
  @name = name
  @maxoccurs = 1
  @minoccurs = 1
  @content = nil
  @ref = nil
  @refelement = nil
end

Instance Attribute Details

#content=(value) ⇒ Object (writeonly)

Sets the attribute content

Parameters:

  • value

    the value to set the attribute content to.



25
26
27
# File 'lib/wsdl/xmlSchema/group.rb', line 25

def content=(value)
  @content = value
end

#maxoccursObject

Returns the value of attribute maxoccurs.



23
24
25
# File 'lib/wsdl/xmlSchema/group.rb', line 23

def maxoccurs
  @maxoccurs
end

#minoccursObject

Returns the value of attribute minoccurs.



24
25
26
# File 'lib/wsdl/xmlSchema/group.rb', line 24

def minoccurs
  @minoccurs
end

#name=(value) ⇒ Object (writeonly)

required



22
23
24
# File 'lib/wsdl/xmlSchema/group.rb', line 22

def name=(value)
  @name = value
end

Instance Method Details

#elementformdefaultObject



44
45
46
# File 'lib/wsdl/xmlSchema/group.rb', line 44

def elementformdefault
  parent.elementformdefault
end

#parse_attr(attr, value) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/wsdl/xmlSchema/group.rb', line 61

def parse_attr(attr, value)
  case attr
  when NameAttrName
    @name = XSD::QName.new(targetnamespace, value.source)
  when RefAttrName
    @ref = value
  when MaxOccursAttrName
    if parent.is_a?(All)
	if value.source != '1'
 raise Parser::AttributeConstraintError.new(
          "cannot parse #{value} for #{attr}")
	end
    end
    if value.source == 'unbounded'
      @maxoccurs = nil
    else
      @maxoccurs = Integer(value.source)
    end
    value.source
  when MinOccursAttrName
    if parent.is_a?(All)
	unless ['0', '1'].include?(value.source)
 raise Parser::AttributeConstraintError.new(
          "cannot parse #{value} for #{attr}")
	end
    end
    @minoccurs = Integer(value.source)
  else
    nil
  end
end

#parse_element(element) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/wsdl/xmlSchema/group.rb', line 48

def parse_element(element)
  case element
  when AllName
    @content = All.new
  when SequenceName
    @content = Sequence.new
  when ChoiceName
    @content = Choice.new
  else
    nil
  end
end

#refelementObject

No longer private: classDefCreator.rb and mappingRegistryCreatorSupport.rb both need to resolve a group ref's actual definition when generating code for a complexType whose sole content is a <xsd:group ref="..."/>.



96
97
98
# File 'lib/wsdl/xmlSchema/group.rb', line 96

def refelement
  @refelement ||= (@ref ? root.collect_modelgroups[@ref] : nil)
end

#targetnamespaceObject



40
41
42
# File 'lib/wsdl/xmlSchema/group.rb', line 40

def targetnamespace
  parent.targetnamespace
end