public class ContentReference
extends java.lang.Object
implements java.io.Serializable
JsonLocation
)
objections, most commonly to be printed out as part of Exception
messages.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_CONTENT_SNIPPET
Include at most first 500 characters/bytes from contents; should be enough
to give context, but not cause unfortunate side effects in things like
logs.
|
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuilder |
appendSourceDescription(java.lang.StringBuilder sb)
Method for appending a "source description" when content represented
by this reference is read.
|
java.lang.String |
buildSourceDescription()
Method for constructing a "source description" when content represented
by this reference is read.
|
static ContentReference |
construct(boolean isContentTextual,
java.lang.Object rawContent) |
static ContentReference |
construct(boolean isContentTextual,
java.lang.Object rawContent,
int offset,
int length) |
int |
contentLength() |
int |
contentOffset() |
boolean |
equals(java.lang.Object other) |
java.lang.Object |
getRawContent() |
int |
hashCode() |
boolean |
hasTextualContent() |
static ContentReference |
rawReference(boolean isContentTextual,
java.lang.Object rawContent)
Factory method for legacy code to use for constructing instances to
content about which only minimal amount of information is available.
|
static ContentReference |
rawReference(java.lang.Object rawContent) |
static ContentReference |
unknown()
Accessor for getting a placeholder for cases where actual content
is not known (or is not something that system wants to expose).
|
public static final int DEFAULT_MAX_CONTENT_SNIPPET
public static ContentReference unknown()
null
referencepublic static ContentReference construct(boolean isContentTextual, java.lang.Object rawContent)
public static ContentReference construct(boolean isContentTextual, java.lang.Object rawContent, int offset, int length)
public static ContentReference rawReference(boolean isContentTextual, java.lang.Object rawContent)
isContentTextual
- Is raw content assumed to have textual content
(true
) or binary (false
)rawContent
- Underlying raw content accesspublic static ContentReference rawReference(java.lang.Object rawContent)
public boolean hasTextualContent()
public java.lang.Object getRawContent()
public int contentOffset()
public int contentLength()
public java.lang.String buildSourceDescription()
public java.lang.StringBuilder appendSourceDescription(java.lang.StringBuilder sb)
sb
- StringBuilder to append description topublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2010 - 2023 Adobe. All Rights Reserved