Parent

Files

Class Index [+]

Quicksearch

WSDL::XMLSchema::Element

Attributes

name[W]
form[W]
type[W]
local_simpletype[W]
local_complextype[W]
constraint[W]
maxoccurs[RW]
minoccurs[RW]
nillable[W]
ref[RW]

Public Class Methods

attr_reader_ref(symbol) click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 19
19:       def attr_reader_ref(symbol)
20:         name = symbol.to_s
21:         define_method(name) {
22:           instance_variable_get("@#{name}") ||
23:             (refelement ? refelement.__send__(name) : nil)
24:         }
25:       end
attr_reader_ref(symbol) click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 27
27:       def attr_reader_ref(symbol)
28:         name = symbol.to_s
29:         module_eval           def #{name}            @#{name} || (refelement ? refelement.#{name} : nil)          end
30:       end
new(name = nil, type = nil) click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 60
60:   def initialize(name = nil, type = nil)
61:     super()
62:     @name = name
63:     @form = nil
64:     @type = type
65:     @local_simpletype = @local_complextype = nil
66:     @constraint = nil
67:     @maxoccurs = 1
68:     @minoccurs = 1
69:     @nillable = nil
70:     @default = nil
71:     @abstract = false
72:     @ref = nil
73:     @refelement = nil
74:   end

Public Instance Methods

anonymous_type?() click to toggle source
    # File lib/wsdl/soap/element.rb, line 22
22:   def anonymous_type?
23:     !@ref and @name and @local_complextype
24:   end
attributes() click to toggle source
    # File lib/wsdl/soap/element.rb, line 26
26:   def attributes
27:     @local_complextype.attributes
28:   end
elementform() click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 92
92:   def elementform
93:     self.form.nil? ? parent.elementformdefault : self.form
94:   end
elementformdefault() click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 88
88:   def elementformdefault
89:     parent.elementformdefault
90:   end
empty?() click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 76
76:   def empty?
77:     !(local_simpletype || local_complextype || constraint || type)
78:   end
map_as_array?() click to toggle source
    # File lib/wsdl/soap/element.rb, line 17
17:   def map_as_array?
18:     # parent sequence / choice may be marked as maxOccurs="unbounded"
19:     maxoccurs.nil? or maxoccurs != 1 or (parent and parent.map_as_array?)
20:   end
parse_attr(attr, value) click to toggle source
     # File lib/wsdl/xmlSchema/element.rb, line 113
113:   def parse_attr(attr, value)
114:     case attr
115:     when NameAttrName
116:       # namespace may be nil
117:       if directelement? or elementform == 'qualified'
118:         @name = XSD::QName.new(targetnamespace, value.source)
119:       else
120:         @name = XSD::QName.new(nil, value.source)
121:       end
122:     when FormAttrName
123:       @form = value.source
124:       if @form != 'qualified' and @name.namespace
125:         @name = XSD::QName.new(nil, @name.name)
126:       end
127:       @form
128:     when TypeAttrName
129:       @type = value
130:     when RefAttrName
131:       @ref = value
132:     when MaxOccursAttrName
133:       if parent.is_a?(All)
134:         if value.source != '1'
135:           raise Parser::AttributeConstraintError.new(
136:             "cannot parse #{value} for #{attr}")
137:         end
138:       end
139:       if value.source == 'unbounded'
140:         @maxoccurs = nil
141:       else
142:         @maxoccurs = Integer(value.source)
143:       end
144:       value.source
145:     when MinOccursAttrName
146:       if parent.is_a?(All)
147:         unless ['0', '1'].include?(value.source)
148:           raise Parser::AttributeConstraintError.new(
149:             "cannot parse #{value} for #{attr}")
150:         end
151:       end
152:       @minoccurs = Integer(value.source)
153:     when NillableAttrName
154:       @nillable = to_boolean(value)
155:     when DefaultAttrName
156:       @default = value.source
157:     when AbstractAttrName
158:       @abstract = to_boolean(value)
159:     else
160:       nil
161:     end
162:   end
parse_element(element) click to toggle source
     # File lib/wsdl/xmlSchema/element.rb, line 96
 96:   def parse_element(element)
 97:     case element
 98:     when SimpleTypeName
 99:       @local_simpletype = SimpleType.new
100:       @local_simpletype
101:     when ComplexTypeName
102:       @type = nil
103:       @local_complextype = ComplexType.new
104:       @local_complextype
105:     when UniqueName
106:       @constraint = Unique.new
107:       @constraint
108:     else
109:       nil
110:     end
111:   end
refelement() click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 80
80:   def refelement
81:     @refelement ||= (@ref ? root.collect_elements[@ref] : nil)
82:   end
targetnamespace() click to toggle source
    # File lib/wsdl/xmlSchema/element.rb, line 84
84:   def targetnamespace
85:     parent.targetnamespace
86:   end

Private Instance Methods

directelement?() click to toggle source
     # File lib/wsdl/xmlSchema/element.rb, line 166
166:   def directelement?
167:     parent.is_a?(Schema)
168:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.