Class TemplateObjectVisitor<TContext>
An object visitor
Implements
Inherited Members
Namespace: Firefly.CloudFormationParser.TemplateObjects.Traversal
Assembly: Firefly.CloudFormationParser.dll
Syntax
public abstract class TemplateObjectVisitor<TContext> : ITemplateObjectVisitor<TContext> where TContext : ITemplateObjectVisitorContext<TContext>
Type Parameters
Name | Description |
---|---|
TContext | The type of the context. |
Constructors
| Improve this Doc View SourceTemplateObjectVisitor(ITemplate)
Initializes a new instance of the TemplateObjectVisitor<TContext> class.
Declaration
protected TemplateObjectVisitor(ITemplate template)
Parameters
Type | Name | Description |
---|---|---|
ITemplate | template | The parsed CloudFormation template. |
Properties
| Improve this Doc View SourcePath
Gets the current path within the object graph.
Declaration
public PropertyPath Path { get; }
Property Value
Type | Description |
---|---|
PropertyPath | The path. |
Template
Gets a reference to the current parsed template.
This is needed when visiting child objects of a IBranchableIntrinsic such that the appropriate sub-properties of the intrinsic are visited according to the prevailing conditions.
Declaration
public ITemplate Template { get; }
Property Value
Type | Description |
---|---|
ITemplate | The template. |
Methods
| Improve this Doc View SourceDoAccept(Object, TContext)
Dispatches the Accept calls added as extension methods to the types of objects encountered in the deserialized YAML object graph.
Declaration
public void DoAccept(object objectInGraph, TContext context)
Parameters
Type | Name | Description |
---|---|---|
Object | objectInGraph | The object. |
TContext | context | The context. |
Visit(IIntrinsic, TContext)
Visits the specified intrinsic and dispatches to visit handler for each distinct subclass of IIntrinsic.
Declaration
protected virtual void Visit(IIntrinsic intrinsic, TContext context)
Parameters
Type | Name | Description |
---|---|---|
IIntrinsic | intrinsic | The intrinsic. |
TContext | context | The context. |
Visit(Boolean, TContext)
Visits the specified boolean value.
Declaration
protected virtual void Visit(bool booleanValue, TContext context)
Parameters
Type | Name | Description |
---|---|---|
Boolean | booleanValue | if set to |
TContext | context | The context. |
Visit(Double, TContext)
Visits the specified double value.
Declaration
protected virtual void Visit(double doubleValue, TContext context)
Parameters
Type | Name | Description |
---|---|---|
Double | doubleValue | The double value. |
TContext | context | The context. |
Visit(Int32, TContext)
Visits the specified integer value.
Declaration
protected virtual void Visit(int integerValue, TContext context)
Parameters
Type | Name | Description |
---|---|---|
Int32 | integerValue | The integer value. |
TContext | context | The context. |
Visit(String, TContext)
Visits the specified string value.
Declaration
protected virtual void Visit(string stringValue, TContext context)
Parameters
Type | Name | Description |
---|---|---|
String | stringValue | The string value. |
TContext | context | The context. |
Visit<TKey>(IDictionary<TKey, Object>, TContext)
Visits the specified dictionary.
Declaration
protected virtual void Visit<TKey>(IDictionary<TKey, object> dict, TContext context)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<TKey, Object> | dict | The dictionary. |
TContext | context | The context. |
Type Parameters
Name | Description |
---|---|
TKey | The type of the key. This should be either string or object(string). |
Visit<TItem>(IList<TItem>, TContext)
Visits the specified list.
Declaration
protected virtual void Visit<TItem>(IList<TItem> list, TContext context)
Parameters
Type | Name | Description |
---|---|---|
IList<TItem> | list | The list. |
TContext | context | The context. |
Type Parameters
Name | Description |
---|---|
TItem | The type of the list item. This should be dictionary, list, intrinsic or any acceptable value type for CloudFormation. |
Visit<TKey>(KeyValuePair<TKey, Object>, TContext)
Visits the specified property, i.e. KeyValuePair<TKey,TValue> of a dictionary object.
Declaration
protected virtual void Visit<TKey>(KeyValuePair<TKey, object> property, TContext context)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, Object> | property | The property. |
TContext | context | The context. |
Type Parameters
Name | Description |
---|---|
TKey | The type of the key. This should be either string or object(string). |
VisitAbstractArrayIntrinsic(AbstractArrayIntrinsic, TContext)
Visits any derivative of AbstractArrayIntrinsic.
Each item in the Items
array of the intrinsic is visited.
Declaration
protected virtual void VisitAbstractArrayIntrinsic(AbstractArrayIntrinsic intrinsic, TContext context)
Parameters
Type | Name | Description |
---|---|---|
AbstractArrayIntrinsic | intrinsic | The intrinsic. |
TContext | context | The context. |
VisitAbstractScalarIntrinsic(AbstractScalarIntrinsic, TContext)
Visits any derivative of AbstractScalarIntrinsic.
Declaration
protected virtual void VisitAbstractScalarIntrinsic(AbstractScalarIntrinsic intrinsic, TContext context)
Parameters
Type | Name | Description |
---|---|---|
AbstractScalarIntrinsic | intrinsic | The intrinsic. |
TContext | context | The context. |
VisitBranchableIntrinsic(IBranchableIntrinsic, TContext)
Visits any derivatives of IBranchableIntrinsic, i.e. !If
and !Select
where only one branch of the intrinsic should be walked base don prevailing conditions.
Whilst both of these intrinsic functions are also inherited from AbstractScalarIntrinsic, this visitor takes precedence for these functions.
Declaration
protected virtual void VisitBranchableIntrinsic(IBranchableIntrinsic intrinsic, TContext context)
Parameters
Type | Name | Description |
---|---|---|
IBranchableIntrinsic | intrinsic | The intrinsic. |
TContext | context | The context. |
VisitSubIntrinsic(SubIntrinsic, TContext)
Visits !Sub
intrinsic which is somewhat a special case,
having both implicit and possibly additional explicit references as a dictionary.
Each of these are visited.
Declaration
protected virtual void VisitSubIntrinsic(SubIntrinsic intrinsic, TContext context)
Parameters
Type | Name | Description |
---|---|---|
SubIntrinsic | intrinsic | The intrinsic. |
TContext | context | The context. |