Package org.openrewrite
Interface SourceFile
- All Superinterfaces:
Tree
- All Known Subinterfaces:
Remote
- All Known Implementing Classes:
Binary,ParseError,PlainText,Quark,RemoteArchive,RemoteFile
-
Method Summary
Modifier and TypeMethodDescriptiondefault <S extends Style>
Sdefault <S extends Style>
Sdefault longA measure of the size of the AST by count of number of AST nodes or some other similar measure.booleandefault StringprintAll()default <P> StringprintAll(PrintOutputCapture<P> out) default <P> StringprintAll(P p) default byte[]default <P> byte[]printAllAsBytes(P p) default Stringdefault <P> StringprintAllTrimmed(P p) default booleanprintEqualsInput(Parser.Input input, ExecutionContext ctx) Does this source file represented as an LST, when printed, produce a byte-for-byte identical result to the original input source file?default <P> TreeVisitor<?,PrintOutputCapture<P>> default <S,T extends S>
T<T extends SourceFile>
TwithCharset(Charset charset) <T extends SourceFile>
TwithCharsetBomMarked(boolean marked) <T extends SourceFile>
TwithChecksum(@Nullable Checksum checksum) <T extends SourceFile>
TwithFileAttributes(@Nullable FileAttributes fileAttributes) <T extends SourceFile>
TwithSourcePath(Path path) Methods inherited from interface org.openrewrite.Tree
accept, cast, getId, getJacksonPolymorphicTypeTag, getMarkers, isAcceptable, isScope, print, print, print, printTrimmed, printTrimmed, printTrimmed, withId, withMarkers
-
Method Details
-
printEqualsInput
Does this source file represented as an LST, when printed, produce a byte-for-byte identical result to the original input source file?- Parameters:
input- The input source.- Returns:
trueif the parse-to-print loop is idempotent,falseotherwise.
-
getSourcePath
Path getSourcePath()- Returns:
- An absolute or relative file path.
-
withSourcePath
-
getCharset
-
withCharset
-
isCharsetBomMarked
boolean isCharsetBomMarked() -
withCharsetBomMarked
-
getChecksum
-
withChecksum
-
getFileAttributes
-
withFileAttributes
-
getStyle
-
getStyle
-
printAllAsBytes
default <P> byte[] printAllAsBytes(P p) -
printAllAsBytes
default byte[] printAllAsBytes() -
printAll
-
printAll
-
printAll
-
printAllTrimmed
-
printAllTrimmed
-
printer
-
service
-
getWeight
A measure of the size of the AST by count of number of AST nodes or some other similar measure. Because perfect referential uniqueness is space inefficient, this weight will always be approximate and is best used for comparative size between two ASTs rather than an absolute measure.- Parameters:
uniqueIdentity- A means of only counting referentially equal AST nodes once. In performance sensitive situations this should use a probabilistic set membership data structure.- Returns:
- The weight of the AST.
-