An implementation of IParseContext that delegates most calls to a parentContext, but adds the capability to locally add lookup results and deserialization properties
Implements
- I
- I
Remarks
Whenever it is necessary to locally modify some context properties, a new instance of this class should be created that wraps an existing one.
See Also
Members
Show:
Constructors
Initializes a new instance of the ChildParseContext class that delegates to the provided context.
Initializes a new instance of the ChildParseContext class that delegates to the provided context.
Parameters
- parentContext: IParseContext
- The parent context.
Initializes a new instance of the ChildParseContext class that delegates to the provided context and adds the currentObject to the objectStack.
Initializes a new instance of the ChildParseContext class that delegates to the provided context and adds the
currentObject to the objectStack.Parameters
- parentContext: IParseContext
- The parent context.
- currentObject: any
- The current object to add to the objectStack and return in getCurrent.
Properties
Gets the currently active graph object.
Gets the currently active graph object.
readonlyfinal
Implements
IParseContext.graphGets the current nesting of created graphs and graph elements.
Gets the current nesting of created graphs and graph elements.
The list contains the user objects which correspond to the GraphML elements which are ancestors of the current node in the DOM tree.
readonlyfinal
Implements
IParseContext.objectStackGets the parent context.
Gets the parent context.
readonlyfinal
Property Value
The parent context.
Gets an implementation of IParseEvents that allows to subscribe to various events in the parse process.
Gets an implementation of IParseEvents that allows to subscribe to various events in the parse process.
readonlyfinal
Implements
IParseContext.parseEventsMethods
This method calls deserializeCore with
context as the first argument and should be used in virtually all cases.Parameters
- targetType: Constructor<T>
- The desired target type.
- targetNode: Node
- The XML node that should be deserialized.
Return Value
- T
- an instance of
Tornull.
Throws
- Exception ({ name: 'DeserializationNotSupportedError' })
See Also
Developer's Guide
API
- deserializeCore
Defined in
IParseContext.deserializeDeserialize the object representation in targetNode
Deserialize the object representation in
targetNodeClient code should usually use the method deserialize instead to ensure the correct
context instance is used.Parameters
- targetType: Constructor<T>
- The expected return type.
- context: IParseContext
- The current parse context.
- targetNode: Node
- The XML node that should be deserialized.
Return Value
- T
- The deserialized object from
targetNodeor an DeserializationNotSupportedError iftargetNodecould not be deserialized.
Implements
IParseContext.deserializeCoreReturns the most current (the last element) within the container hierarchy as it is returned by objectStack or default(T) if the most current element is not of the desired target type.
Returns the most current (the last element) within the container hierarchy as it is returned by objectStack or
default(T) if the most current element is not of the desired target type.final
Parameters
- itemType: Constructor<T>
- The desired target type.
Return Value
- T
- The most current element within the container hierarchy or
default(T).
Implements
IParseContext.getCurrentParameters
- key: string
- The identifier for the property
Return Value
- any
- The property value, or
nullif no such property exists.
Implements
IParseContext.getDeserializationPropertyTypically, this method will be called to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile-time constraints. An instance implementing this method is not required to return non-
null implementations for the types, nor does it have to return the same instance any time. Also, it depends on the type and context whether the instance returned stays up to date or needs to be re-obtained for further use.Parameters
- type: Constructor<T>
- the type for which an instance shall be returned
Return Value
- T
- an instance that is assignable to the type or
null
Implements
ILookup.lookupRemoves a previously locally set deserialization property.
Removes a previously locally set deserialization property.
Parameters
- key: string
- The key for which the local property override should be removed.
Removes a local lookup override that has been added using setLookup
Removes a local lookup override that has been added using setLookup
Parameters
- tType: Constructor<T>
- The type key to remove.
Parameters
- key: string
- The key to override.
- value: any
- The value.
Parameters
- tType: Constructor<T>
- The type to use as a key for the lookup.
- value: T
- The value to provide for queries to
T.
See Also
API
- removeLookup