Class AbstractIntrinsic
Abstract base class for CloudFormation intrinsics
Inherited Members
Namespace: Firefly.CloudFormationParser.Intrinsics.Abstractions
Assembly: Firefly.CloudFormationParser.dll
Syntax
public abstract class AbstractIntrinsic : IIntrinsic, IEnumerable<object>, IEnumerable
Constructors
| Improve this Doc View SourceAbstractIntrinsic()
Initializes a new instance of the AbstractIntrinsic class.
Declaration
protected AbstractIntrinsic()
AbstractIntrinsic(Object)
Initializes a new instance of the AbstractIntrinsic class.
Declaration
protected AbstractIntrinsic(object value)
Parameters
Type | Name | Description |
---|---|---|
Object | value | The value. |
AbstractIntrinsic(Object, Boolean)
Initializes a new instance of the AbstractIntrinsic class.
Declaration
protected AbstractIntrinsic(object value, bool useLongForm)
Parameters
Type | Name | Description |
---|---|---|
Object | value | The value. |
Boolean | useLongForm | If set to |
Properties
| Improve this Doc View SourceExtraData
Gets or sets the extra data.
Declaration
public object ExtraData { get; set; }
Property Value
Type | Description |
---|---|
Object | The extra data that may be stored against an intrinsic instance by client applications. |
LongName
Gets the long name of the intrinsic.
Declaration
public abstract string LongName { get; }
Property Value
Type | Description |
---|---|
String | The long name. |
TagName
Gets the YAML tag name.
Declaration
public abstract string TagName { get; }
Property Value
Type | Description |
---|---|
String | The name of the tag. |
Type
Gets the intrinsic type for this intrinsic.
Declaration
public abstract IntrinsicType Type { get; }
Property Value
Type | Description |
---|---|
IntrinsicType | The type. |
UseLongForm
Gets a value indicating whether to use the long form when serializing.
Declaration
public bool UseLongForm { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
Methods
| Improve this Doc View SourceEvaluate(ITemplate)
Evaluates the result of the intrinsic function.
Declaration
public abstract object Evaluate(ITemplate template)
Parameters
Type | Name | Description |
---|---|---|
ITemplate | template | Reference to the template being processed |
Returns
Type | Description |
---|---|
Object | The result. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<object> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<Object> | An enumerator that can be used to iterate through the collection. |
GetReferencedObjects(ITemplate)
Gets a list of referenced resources and/or parameters in this expression
Declaration
public abstract IEnumerable<string> GetReferencedObjects(ITemplate template)
Parameters
Type | Name | Description |
---|---|---|
ITemplate | template | Reference to the template being processed |
Returns
Type | Description |
---|---|
IEnumerable<String> | List of references |
SetValue(IEnumerable<Object>)
Sets the values for the intrinsic.
This is a list of objects, whose length depends on the number of properties (usually list elements) supported by the intrinsic.
Each element depending on the intrinsic, may be a scalar value, another intrinsic or another list of items e.g. for !Join
or !Select
Declaration
protected abstract void SetValue(IEnumerable<object> values)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Object> | values | Values to assign to the intrinsic |
SetValue(Object)
Sets the values for the intrinsic.
This is a single scalar or intrinsic object or a list of objects. This is a convenience method which wraps a scalar and then calls SetValue(IEnumerable<Object>)
Declaration
protected void SetValue(object value)
Parameters
Type | Name | Description |
---|---|---|
Object | value | Value to assign to the intrinsic |
UnpackIntrinsic(Object)
Unpack an intrinsic from a long form dictionary entry e.g. { "Fn::Sub", SubIntrinsic }
Declaration
protected object UnpackIntrinsic(object value)
Parameters
Type | Name | Description |
---|---|---|
Object | value | The value to unpack. |
Returns
Type | Description |
---|---|
Object | If |
ValidateValues(Int32, Int32, IList<Object>)
Performs some validation on the number of values being set on this intrinsic.
Declaration
protected void ValidateValues(int minValues, int maxValues, IList<object> values)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minValues | The minimum values. |
Int32 | maxValues | The maximum values. |
IList<Object> | values | The values. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Number of values being assigned is outside the min and max constraints, |
WriteYaml(IEmitter, IValueSerializer)
Writes this intrinsic to a YAML emitter.
Declaration
public void WriteYaml(IEmitter emitter, IValueSerializer nestedValueSerializer)
Parameters
Type | Name | Description |
---|---|---|
YamlDotNet.Core.IEmitter | emitter | The emitter. |
YamlDotNet.Serialization.IValueSerializer | nestedValueSerializer | An YamlDotNet.Serialization.IValueSerializer with which to write nested objects such as dictionaries. |
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator | An IEnumerator object that can be used to iterate through the collection. |