public interface StatementWriter
Modifier and Type | Interface and Description |
---|---|
static interface |
StatementWriter.ResumedStatement
Resumed statement state.
|
Modifier and Type | Method and Description |
---|---|
void |
endStatement(@NonNull StatementSourceReference ref)
Ends current opened statement.
|
@NonNull ModelProcessingPhase |
getPhase()
Return current model processing phase.
|
default Optional<? extends StatementWriter.ResumedStatement> |
resumeStatement(int childId)
Attempt to resume a child statement.
|
void |
startStatement(int childId,
@NonNull QName name,
@Nullable String argument,
@NonNull StatementSourceReference ref)
Starts statement with supplied name and location in source.
|
default void |
storeStatement(int expectedChildren,
boolean fullyDefined)
Store a defined statement, hinting at the number of children it is expected to have and indicating whether
it has been fully defined.
|
@Beta default Optional<? extends StatementWriter.ResumedStatement> resumeStatement(int childId)
StatementWriter.ResumedStatement
instance is returned.
If an empty optional is returned, the caller is expected to follow-up with
startStatement(int, QName, String, StatementSourceReference)
to define the statement.
If the returned resumed statement indicates StatementWriter.ResumedStatement.isFullyDefined()
, the caller should take
no further action with this or any of the child statements. Otherwise this call is equivalent of issuing
startStatement(int, QName, String, StatementSourceReference)
and the caller is expected to process
any child statements. The caller should call storeStatement(int, boolean)
before finishing processing
with endStatement(StatementSourceReference)
.
childId
- Child@Beta default void storeStatement(int expectedChildren, boolean fullyDefined)
endStatement(StatementSourceReference)
when the caller is taking advantage of resumeStatement(int)
.expectedChildren
- Number of expected children, cannot be negativefullyDefined
- True if the statement and all its descendants have been defined.void startStatement(int childId, @NonNull QName name, @Nullable String argument, @NonNull StatementSourceReference ref)
Each started statement must also be closed by
endStatement(StatementSourceReference)
in order for stream to be
correct.
If statement has substatements, in order to start substatement, call to
startStatement(int, QName, String, StatementSourceReference)
needs to be done for substatement.
childId
- Child identifier, unique among siblingsname
- Fully qualified name of statement.argument
- String representation of value as appeared in source, null if not presentref
- Identifier of location in source, which will be used for reporting in case of statement processing
error.SourceException
- if statement is not valid according to current context.void endStatement(@NonNull StatementSourceReference ref)
ref
- Identifier of location in source, which will be used for reporting in case of statement processing
error.SourceException
- if closed statement is not valid in current context, or there is no such statement@NonNull ModelProcessingPhase getPhase()
Copyright © 2019 OpenDaylight. All rights reserved.