public class IdempotentDeclarationWalker extends DeclarationWalker
DeclarationWalker
which assures that each component is visited only once, making it easy to handle the fact that some
components such as OperationDeclaration
, SourceDeclaration
, ConnectionProviderDeclaration
, etc,
implement the flyweight pattern, which means that the same instance might be present at different levels.
The use of this walker makes it unnecessary to manually control if a given component has already been seen.
Constructor and Description |
---|
IdempotentDeclarationWalker() |
Modifier and Type | Method and Description |
---|---|
protected void |
onConnectionProvider(ConnectedDeclaration owner,
ConnectionProviderDeclaration declaration)
Invoked when an
ConnectedDeclaration is found in the
traversed extensionDeclaration |
protected void |
onConnectionProvider(ConnectionProviderDeclaration declaration)
Invoked when an
ConnectedDeclaration is found in the traversed extensionDeclaration . |
protected void |
onConstruct(ConstructDeclaration declaration)
Invoked when a
ConstructDeclaration is found in the traversed extensionDeclaration . |
protected void |
onConstruct(WithConstructsDeclaration owner,
ConstructDeclaration declaration)
Invoked when a
ConstructDeclaration is found in the
traversed extensionDeclaration . |
protected void |
onOperation(OperationDeclaration declaration)
Invoked when an
OperationDeclaration is found in the traversed extensionDeclaration . |
protected void |
onOperation(WithOperationsDeclaration owner,
OperationDeclaration declaration)
Invoked when an
OperationDeclaration is found in the
traversed extensionDeclaration . |
protected void |
onParameter(ParameterGroupDeclaration parameterGroup,
ParameterDeclaration declaration)
Invoked when an
ParameterDeclaration is found in the traversed extensionDeclaration . |
protected void |
onParameter(ParameterizedDeclaration owner,
ParameterGroupDeclaration parameterGroup,
ParameterDeclaration declaration)
Invoked when an
ParameterDeclaration is found in the
traversed extensionDeclaration |
protected void |
onParameterGroup(ParameterGroupDeclaration declaration)
Invoked when an
ParameterGroupDeclaration is found in the traversed extensionDeclaration |
protected void |
onParameterGroup(ParameterizedDeclaration owner,
ParameterGroupDeclaration declaration)
Invoked when an
ParameterGroupDeclaration is found in the
traversed extensionDeclaration |
protected void |
onSource(SourceDeclaration declaration)
Invoked when an
SourceDeclaration is found in the traversed extensionDeclaration |
protected void |
onSource(WithSourcesDeclaration owner,
SourceDeclaration declaration)
Invoked when an
SourceDeclaration is found in the
traversed extensionDeclaration |
onConfiguration, stop, walk
protected void onSource(WithSourcesDeclaration owner, SourceDeclaration declaration)
SourceDeclaration
is found in the
traversed extensionDeclaration
onSource
in class DeclarationWalker
owner
- The declaration that owns the sourcedeclaration
- the SourceDeclaration
protected void onParameterGroup(ParameterizedDeclaration owner, ParameterGroupDeclaration declaration)
ParameterGroupDeclaration
is found in the
traversed extensionDeclaration
onParameterGroup
in class DeclarationWalker
owner
- The declaration that owns the parameterdeclaration
- the ParameterGroupDeclaration
protected void onParameter(ParameterizedDeclaration owner, ParameterGroupDeclaration parameterGroup, ParameterDeclaration declaration)
ParameterDeclaration
is found in the
traversed extensionDeclaration
onParameter
in class DeclarationWalker
owner
- The declaration that owns the parameterparameterGroup
- the group to which the declaration belongsdeclaration
- the ParameterDeclaration
protected void onOperation(WithOperationsDeclaration owner, OperationDeclaration declaration)
OperationDeclaration
is found in the
traversed extensionDeclaration
.
onOperation
in class DeclarationWalker
owner
- The declaration that owns the operationdeclaration
- the WithOperationsDeclaration
protected void onConstruct(WithConstructsDeclaration owner, ConstructDeclaration declaration)
DeclarationWalker
ConstructDeclaration
is found in the
traversed extensionDeclaration
.
onConstruct
in class DeclarationWalker
owner
- The declaration that owns the operationdeclaration
- the WithOperationsDeclaration
protected void onConnectionProvider(ConnectedDeclaration owner, ConnectionProviderDeclaration declaration)
ConnectedDeclaration
is found in the
traversed extensionDeclaration
onConnectionProvider
in class DeclarationWalker
owner
- The declaration that owns the providerdeclaration
- the ConnectionProviderDeclaration
protected void onConnectionProvider(ConnectionProviderDeclaration declaration)
ConnectedDeclaration
is found in the traversed extensionDeclaration
.
This method will only be invoked once per each found instance
declaration
- the ConnectionProviderDeclaration
protected void onSource(SourceDeclaration declaration)
SourceDeclaration
is found in the traversed extensionDeclaration
This method will only be invoked once per each found instance
declaration
- the SourceDeclaration
protected void onParameterGroup(ParameterGroupDeclaration declaration)
ParameterGroupDeclaration
is found in the traversed extensionDeclaration
This method will only be invoked once per each found instance
declaration
- the SourceDeclaration
protected void onParameter(ParameterGroupDeclaration parameterGroup, ParameterDeclaration declaration)
ParameterDeclaration
is found in the traversed extensionDeclaration
.
This method will only be invoked once per each found instance
parameterGroup
- the ParameterGroupDeclaration
in which the declaration
is containeddeclaration
- the ParameterDeclaration
protected void onOperation(OperationDeclaration declaration)
OperationDeclaration
is found in the traversed extensionDeclaration
.
This method will only be invoked once per each found instance.
declaration
- the WithOperationsDeclaration
protected void onConstruct(ConstructDeclaration declaration)
ConstructDeclaration
is found in the traversed extensionDeclaration
.
This method will only be invoked once per each found instance.
declaration
- the WithOperationsDeclaration
Copyright © 2018. All rights reserved.