Class TerminalViewChecks
java.lang.Object
org.apache.juneau.terminal.report.TerminalViewChecks
Shared validation grammar; not intended for application use.
The terminal-view grammars live in one place so the server types, the report readers and the client module (which mirrors them, pinned by a shared vectors file) cannot drift.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe refresh floor, in milliseconds, for terminal-view and terminal poll intervals.static final StringThe byte-offset placeholder; a raw-href template contains it exactly once. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringTruncates a value for an error message: 64 characters plus an ellipsis.static StringReturns the stripped first line of a string.static booleanWhether the string is a valid framework key.static booleanisNoteHref(String s) Whether the string is a safe note href.static booleanWhether the string is a valid raw-href template.static booleanWhether the string is a valid run id.static booleanWhether a line href is safe: a bare fragment, or a same-origin path accepted byisSameOriginPath(String).static booleanisSameOriginPath(String path) Whether the string is a same-origin path template, by the one shared rule inSafePathTemplate.isSameOriginPath(String): no:// , no// prefix, no scheme colon-before-slash, no.. path segment, and no backslash, control character, or leading or trailing space.static booleanWhether the string is a valid step id.static booleanWhether the string is a valid opaque page token.
-
Field Details
-
OFFSET_PLACEHOLDER
The byte-offset placeholder; a raw-href template contains it exactly once.- See Also:
-
MIN_REFRESH_MS
The refresh floor, in milliseconds, for terminal-view and terminal poll intervals.- See Also:
-
-
Method Details
-
isRunId
Whether the string is a valid run id.- Parameters:
s- The candidate. May benull .- Returns:
true if valid.
-
isToken
Whether the string is a valid opaque page token.- Parameters:
s- The candidate. May benull .- Returns:
true if valid.
-
isStepId
Whether the string is a valid step id.- Parameters:
s- The candidate. May benull .- Returns:
true if valid.
-
isFw
Whether the string is a valid framework key.- Parameters:
s- The candidate. May benull .- Returns:
true if valid.
-
isNoteHref
Whether the string is a safe note href.Either an absolute URL whose scheme is exactly
http orhttps and which has a non-empty host, or anything thatisSafeLineHref(String)accepts. TAB, CR and LF are stripped first.- Parameters:
s- The candidate. May benull .- Returns:
true if safe.
-
isRawHrefTemplate
Whether the string is a valid raw-href template.It must contain exactly one
{offset} placeholder and, with1 substituted, be a safe line href.- Parameters:
s- The candidate. May benull .- Returns:
true if valid.
-
isSafeLineHref
Whether a line href is safe: a bare fragment, or a same-origin path accepted byisSameOriginPath(String).TAB, CR and LF are stripped first. A backslash anywhere refuses the href.
- Parameters:
s- The candidate href. May benull .- Returns:
true if the href is safe.
-
isSameOriginPath
Whether the string is a same-origin path template, by the one shared rule inSafePathTemplate.isSameOriginPath(String): no:// , no// prefix, no scheme colon-before-slash, no.. path segment, and no backslash, control character, or leading or trailing space.- Parameters:
path- The candidate template. May benull .- Returns:
true if the string is a same-origin path template.
-
clip
Truncates a value for an error message: 64 characters plus an ellipsis.- Parameters:
s- The value. May benull .- Returns:
- The clipped text, or
"null" fornull .
-
firstLine
Returns the stripped first line of a string.- Parameters:
s- The string. May benull .- Returns:
- The first line, or an empty string for
null .
-