public class QuerySpaceTreePrinter extends Object
QuerySpaces
graph as a tree structure.
Intended for use in debugging, logging, etc.Modifier and Type | Field and Description |
---|---|
static QuerySpaceTreePrinter |
INSTANCE
Singleton access
|
Modifier and Type | Method and Description |
---|---|
String |
asString(QuerySpaces spaces,
AliasResolutionContext aliasResolutionContext)
Returns a String containing the
QuerySpaces graph as a tree structure. |
String |
asString(QuerySpaces spaces,
int depth,
AliasResolutionContext aliasResolutionContext)
Returns a String containing the
QuerySpaces graph as a tree structure, starting
at a particular depth. |
String |
extractDetails(QuerySpace space)
Returns a String containing high-level details about the
QuerySpace , such as:
query space class name
unique ID
entity name (for EntityQuerySpace
collection role (for CollectionQuerySpace *
|
void |
write(QuerySpaces spaces,
int depth,
AliasResolutionContext aliasResolutionContext,
PrintStream printStream)
Returns a String containing the
QuerySpaces graph as a tree structure, starting
at a particular depth. |
void |
write(QuerySpaces spaces,
int depth,
AliasResolutionContext aliasResolutionContext,
PrintWriter printWriter)
Returns a String containing the
QuerySpaces graph as a tree structure, starting
at a particular depth. |
public static final QuerySpaceTreePrinter INSTANCE
public String asString(QuerySpaces spaces, AliasResolutionContext aliasResolutionContext)
QuerySpaces
graph as a tree structure.spaces
- The QuerySpaces
object.aliasResolutionContext
- The context for resolving table and column aliases
for the QuerySpace
references in spaces
; if null,
table and column aliases are not included in returned value..QuerySpaces
graph as a tree structure.public String asString(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext)
QuerySpaces
graph as a tree structure, starting
at a particular depth.
The value for depth indicates the number of indentations that will
prefix all lines in the returned String. Root query spaces will be written with depth + 1
and the depth will be further incremented as joined query spaces are traversed.
An indentation is defined as the number of characters defined by TreePrinterHelper.INDENTATION
.spaces
- The QuerySpaces
object.depth
- The intial number of indentationsaliasResolutionContext
- The context for resolving table and column aliases
for the QuerySpace
references in spaces
; if null,
table and column aliases are not included in returned value..QuerySpaces
graph as a tree structure.public void write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, PrintStream printStream)
QuerySpaces
graph as a tree structure, starting
at a particular depth.
The value for depth indicates the number of indentations that will
prefix all lines in the returned String. Root query spaces will be written with depth + 1
and the depth will be further incremented as joined query spaces are traversed.
An indentation is defined as the number of characters defined by TreePrinterHelper.INDENTATION
.spaces
- The QuerySpaces
object.depth
- The intial number of indentationsaliasResolutionContext
- The context for resolving table and column aliases
for the QuerySpace
references in spaces
; if null,
table and column aliases are not included in returned value.printStream
- The print stream for writing.public void write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)
QuerySpaces
graph as a tree structure, starting
at a particular depth.
The value for depth indicates the number of indentations that will
prefix all lines in the returned String. Root query spaces will be written with depth + 1
and the depth will be further incremented as joined query spaces are traversed.
An indentation is defined as the number of characters defined by TreePrinterHelper.INDENTATION
.spaces
- The QuerySpaces
object.depth
- The intial number of indentationsaliasResolutionContext
- The context for resolving table and column aliases
for the QuerySpace
references in spaces
; if null,
table and column aliases are not included in returned value.printWriter
- The print writer for writing.public String extractDetails(QuerySpace space)
QuerySpace
, such as:
EntityQuerySpace
CollectionQuerySpace
space
- The query spaceQuerySpace
Copyright © 2021 JBoss by Red Hat. All rights reserved.