C

ChildParseContext

An implementation of IParseContext that delegates most calls to a parentContext, but adds the capability to locally add lookup results and deserialization properties
ImplementsInheritance Hierarchy

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

API

setDeserializationProperty, setLookup

Members

Show:

Constructors

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.

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.
readonlyfinal
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
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.
readonlyfinal

Methods

Deserialize the object representation in targetNode.
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 T or null.

Throws

Exception ({ name: 'DeserializationNotSupportedError' })

See Also

Developer's Guide
API
deserializeCore
Deserialize the object representation in targetNode
Client 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 targetNode or an DeserializationNotSupportedError if targetNode could not be deserialized.
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).
Get a property value that specifies information about how to handle specific cases.

Parameters

key: string
The identifier for the property

Return Value

any
The property value, or null if no such property exists.
Returns an instance that implements the given type or null.
Typically, 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.lookup
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

Parameters

tType: Constructor<T>
The type key to remove.
Sets the local deserialization property for the given key to the value.

Parameters

key: string
The key to override.
value: any
The value.
Adds another lookup result to the local lookup override.

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