Class: Aws::Xml::Parser Private
- Inherits:
-
Object
- Object
- Aws::Xml::Parser
- Defined in:
- lib/aws-sdk-core/xml/parser.rb,
lib/aws-sdk-core/xml/parser/frame.rb,
lib/aws-sdk-core/xml/parser/stack.rb,
lib/aws-sdk-core/xml/parser/engines/ox.rb,
lib/aws-sdk-core/xml/parser/engines/rexml.rb,
lib/aws-sdk-core/xml/parser/parsing_error.rb,
lib/aws-sdk-core/xml/parser/engines/libxml.rb,
lib/aws-sdk-core/xml/parser/engines/nokogiri.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A SAX-style XML parser that uses a shape context to handle types.
Defined Under Namespace
Classes: BlobFrame, BooleanFrame, FlatListFrame, FloatFrame, Frame, IntegerFrame, LibxmlEngine, ListFrame, MapEntryFrame, MapFrame, NokogiriEngine, NullFrame, OxEngine, ParsingError, RexmlEngine, Stack, StringFrame, StructureFrame, TimestampFrame
Class Method Summary collapse
-
.engine ⇒ Class
private
Returns the default parsing engine.
- .engine=(engine) ⇒ Object private
Instance Method Summary collapse
-
#initialize(shape, options = {}) ⇒ Parser
constructor
private
A new instance of Parser.
- #parse(xml, target = nil) ⇒ Structure private
Constructor Details
#initialize(shape, options = {}) ⇒ Parser
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Parser.
17 18 19 20 |
# File 'lib/aws-sdk-core/xml/parser.rb', line 17 def initialize(shape, = {}) @shape = shape @engine = [:engine] || self.class.engine end |
Class Method Details
.engine ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the default parsing engine. One of:
54 55 56 |
# File 'lib/aws-sdk-core/xml/parser.rb', line 54 def engine @engine end |
.engine=(engine) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/aws-sdk-core/xml/parser.rb', line 42 def engine= engine @engine = Class === engine ? engine : load_engine(engine) end |
Instance Method Details
#parse(xml, target = nil) ⇒ Structure
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 29 30 |
# File 'lib/aws-sdk-core/xml/parser.rb', line 25 def parse(xml, target = nil) xml = '<xml/>' if xml.nil? or xml.empty? stack = Stack.new(@shape, target) @engine.new(stack).parse(xml.to_s) stack.result end |