TokenBuffer. This buffer
is available through the getResult() method.
| Modifier and Type | Field and Description |
|---|---|
| private final AbbreviationProvider | abbreviationProvider
An optional abbreviation provider (may be |
| private final CSLCitation | citation
The citation to render. |
| private final CSLCitationItem | citationItem
The citation item to render |
| private final List | generatedCitations
All citations generated so far. |
| private final SNameInheritableAttributes | inheritedNameAttributes
Attributes for name elements inherited from the style, bibliography, or citation |
| private final CSLItemData | itemData
The citation item data to render |
| private final AtomicReference | lastLabelRendered
The last label rendered. |
| private final LLocale | locale
Localization data |
| private final TokenBuffer | result
A token buffer collecting the rendered text |
| private final SStyle | style
The style used to render citation items and bibliographies |
| private final Set | suppressedVariables
A set of variables that should not be rendered any more for the rest of
the output (i.e. where the context should pretend the variable's value
is |
| private final Set | variableListeners
A set of listeners to call whenever a variable value is fetched from the context |
| Access | Constructor and Description |
|---|---|
| public | RenderContext(SStyle
the style used to render citation items and bibliographies style, LLocale localization data locale, CSLItemData the citation item to render itemData, AbbreviationProvider an optional abbreviation provider (may be abbreviationProvider)null)Creates a new render context |
| public | RenderContext(SStyle
the style used to render citation items and bibliographies style, LLocale localization data locale, CSLItemData the citation item to render itemData, AbbreviationProvider an optional abbreviation provider (may be abbreviationProvider, CSLCitation null)the citation to render citation, List<GeneratedCitation> all citations generated so far generatedCitations)Creates a new render context |
| public | RenderContext(RenderContext
the parent context parent)Creates a new render context that has the same attributes as the given parent context but with an empty token buffer. |
| public | RenderContext(RenderContext
the parent context parent, SNameInheritableAttributes the new inherited name attributes inheritedNameAttributes)Creates a new render context that has the same attributes as the given parent context but with an empty token buffer and different inherited name attributes. |
| public | RenderContext(RenderContext
the parent context parent, CSLCitationItem the citation item to render citationItem)Creates a new render context that has the same attributes as the given parent context but with an empty token buffer and a different citation item. |
| private | RenderContext(RenderContext
the parent context parent, CSLItemData the citation item data to render itemData, CSLCitation the citation to render citation, List<GeneratedCitation> all citations generated so far generatedCitations, CSLCitationItem the citation item to render citationItem, SNameInheritableAttributes inherited name attributes inheritedNameAttributes)Creates a new render context that has the same attributes as the given parent context but with an empty token buffer and a different citation item. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addVariableListener(VariableListener
the variable listener to register listener)Adds a variable listener to this context |
| public RenderContext | |
| public RenderContext | |
| public RenderContext | |
| public RenderContext | |
| public RenderContext | |
| public RenderContext | Returns: this render contextthe token buffer buffer)Emit all tokens from the given token buffer |
| public RenderContext | Returns: this render contextthe token buffer buffer, int the formatting attributes to append formattingAttributes)Emit all tokens from the given token buffer and wrap the given
formatting attributes around them (unless the are |
| public CSLCitation | |
| public CSLCitationItem | |
| public CSLDate | Returns: the variable's value ornull if the value is not setthe variable's name name)Get the value of the date variable with the given name |
| public CSLDate | Returns: the variable's value ornull if the value is not setthe variable's name name, boolean true if VariableListeners should
not be notified about this call.Get the value of the date variable with the given name |
| public List | |
| public SNameInheritableAttributes | Returns: the attributesGet attributes that can be inherited to name elements |
| public CSLItemData | |
| public Locale | |
| public SLabel | |
| public LLocale | |
| public SMacro | |
| public CSLName[] | |
| public CSLName[] | |
| public TokenBuffer | |
| public String | Returns: the variable's value ornull if the value is not setthe variable's name name)Get the value of the string variable with the given name |
| public String | Returns: the variable's value ornull if the value is not setthe variable's name name, boolean true if VariableListeners should
not be notified about this call.Get the value of the string variable with the given name |
| public String | Returns: the variable's value ornull if the value is not setthe variable's name name, VariableForm the variable form to get form)Get the value of the string variable with the given name |
| public String | Returns: the variable's value ornull if the value is not setthe variable's name name, VariableForm the variable form to get form, boolean true if VariableListeners should
not be notified about this call.Get the value of the string variable with the given name |
| public SStyle | |
| public String | |
| public String | |
| public String | |
| public String | |
| public Object | Returns: the variable's value ornull if the value is not setthe variable's name name)Get the value of a string, date, or name variable |
| public Object | Returns: the variable's value ornull if the value is not setthe variable's name name, boolean true if VariableListeners should
not be notified about this call.Get the value of a string, date, or name variable |
| public Set | |
| public void | removeVariableListener(VariableListener
the variable listener to remove listener)Removes a variable listener from this context |
| public void | |
| public void | |
| public void |
| abbreviationProvider | back to summary |
|---|---|
| private final AbbreviationProvider abbreviationProvider An optional abbreviation provider (may be | |
| citation | back to summary |
|---|---|
| private final CSLCitation citation The citation to render. Will be | |
| citationItem | back to summary |
|---|---|
| private final CSLCitationItem citationItem The citation item to render | |
| generatedCitations | back to summary |
|---|---|
| private final List<GeneratedCitation> generatedCitations All citations generated so far. Will be | |
| inheritedNameAttributes | back to summary |
|---|---|
| private final SNameInheritableAttributes inheritedNameAttributes Attributes for name elements inherited from the style, bibliography, or citation | |
| itemData | back to summary |
|---|---|
| private final CSLItemData itemData The citation item data to render | |
| lastLabelRendered | back to summary |
|---|---|
| private final AtomicReference<SLabel> lastLabelRendered The last label rendered. This field is an | |
| locale | back to summary |
|---|---|
| private final LLocale locale Localization data | |
| result | back to summary |
|---|---|
| private final TokenBuffer result A token buffer collecting the rendered text | |
| style | back to summary |
|---|---|
| private final SStyle style The style used to render citation items and bibliographies | |
| suppressedVariables | back to summary |
|---|---|
| private final Set<String> suppressedVariables A set of variables that should not be rendered any more for the rest of
the output (i.e. where the context should pretend the variable's value
is | |
| variableListeners | back to summary |
|---|---|
| private final Set<VariableListener> variableListeners A set of listeners to call whenever a variable value is fetched from the context | |
| RenderContext | back to summary |
|---|---|
| public RenderContext(SStyle style, LLocale locale, CSLItemData itemData, AbbreviationProvider abbreviationProvider) Creates a new render context
| |
| RenderContext | back to summary |
|---|---|
| public RenderContext(SStyle style, LLocale locale, CSLItemData itemData, AbbreviationProvider abbreviationProvider, CSLCitation citation, List<GeneratedCitation> generatedCitations) Creates a new render context
| |
| RenderContext | back to summary |
|---|---|
| public RenderContext(RenderContext parent) Creates a new render context that has the same attributes as the given parent context but with an empty token buffer. Changes to any of the properties (except for the token buffer) will reflect in the parent context.
| |
| RenderContext | back to summary |
|---|---|
| public RenderContext(RenderContext parent, SNameInheritableAttributes inheritedNameAttributes) Creates a new render context that has the same attributes as the given parent context but with an empty token buffer and different inherited name attributes. Changes to any of the properties (except for the token buffer) will reflect in the parent context.
| |
| RenderContext | back to summary |
|---|---|
| public RenderContext(RenderContext parent, CSLCitationItem citationItem) Creates a new render context that has the same attributes as the given parent context but with an empty token buffer and a different citation item. Changes to any of the properties (except for the token buffer) will reflect in the parent context.
| |
| RenderContext | back to summary |
|---|---|
| private RenderContext(RenderContext parent, CSLItemData itemData, CSLCitation citation, List<GeneratedCitation> generatedCitations, CSLCitationItem citationItem, SNameInheritableAttributes inheritedNameAttributes) Creates a new render context that has the same attributes as the given parent context but with an empty token buffer and a different citation item. Changes to any of the properties (except for the token buffer) will reflect in the parent context.
| |
| addVariableListener | back to summary |
|---|---|
| public void addVariableListener(VariableListener listener) Adds a variable listener to this context
| |
| emit | back to summary |
|---|---|
| public RenderContext emit(String text) Emit a text token
| |
| emit | back to summary |
|---|---|
| public RenderContext emit(String text, int formattingAttributes) Emit a text token with the given formatting attributes
| |
| emit | back to summary |
|---|---|
| public RenderContext emit(String text, TextToken. Emit a text token of a given type
| |
| emit | back to summary |
|---|---|
| public RenderContext emit(String text, TextToken. Emit a text token of a given type and with the specified formatting attributes
| |
| emit | back to summary |
|---|---|
| public RenderContext emit(Token token) Emit a token
| |
| emit | back to summary |
|---|---|
| public RenderContext emit(TokenBuffer buffer) Emit all tokens from the given token buffer
| |
| emit | back to summary |
|---|---|
| public RenderContext emit(TokenBuffer buffer, int formattingAttributes) Emit all tokens from the given token buffer and wrap the given
formatting attributes around them (unless the are
| |
| getCitation | back to summary |
|---|---|
| public CSLCitation getCitation() Get the citation currently being rendered. Will return
| |
| getCitationItem | back to summary |
|---|---|
| public CSLCitationItem getCitationItem() Get the citation item currently being rendered
| |
| getDateVariable | back to summary |
|---|---|
| public CSLDate getDateVariable(String name) Get the value of the date variable with the given name
| |
| getDateVariable | back to summary |
|---|---|
| public CSLDate getDateVariable(String name, boolean ignoreListeners) Get the value of the date variable with the given name
| |
| getGeneratedCitations | back to summary |
|---|---|
| public List Get all citations generated so far. Will return
| |
| getInheritedNameAttributes | back to summary |
|---|---|
| public SNameInheritableAttributes getInheritedNameAttributes() Get attributes that can be inherited to name elements
| |
| getItemData | back to summary |
|---|---|
| public CSLItemData getItemData() Get the citation item data currently being rendered
| |
| getItemLocale | back to summary |
|---|---|
| public Locale getItemLocale() Get the
| |
| getLastLabelRendered | back to summary |
|---|---|
| public SLabel getLastLabelRendered() Get the last label rendered
| |
| getLocale | back to summary |
|---|---|
| public LLocale getLocale() Get the localization data
| |
| getMacro | back to summary |
|---|---|
| public SMacro getMacro(String name) Get the macro with the given name | |
| getNameVariable | back to summary |
|---|---|
| public CSLName[] getNameVariable(String name) | |
| getNameVariable | back to summary |
|---|---|
| public CSLName[] getNameVariable(String name, boolean ignoreListeners) | |
| getResult | back to summary |
|---|---|
| public TokenBuffer getResult() Get a token buffer containing all emitted tokens
| |
| getStringVariable | back to summary |
|---|---|
| public String getStringVariable(String name) Get the value of the string variable with the given name
| |
| getStringVariable | back to summary |
|---|---|
| public String getStringVariable(String name, boolean ignoreListeners) Get the value of the string variable with the given name
| |
| getStringVariable | back to summary |
|---|---|
| public String getStringVariable(String name, VariableForm form) Get the value of the string variable with the given name
| |
| getStringVariable | back to summary |
|---|---|
| public String getStringVariable(String name, VariableForm form, boolean ignoreListeners) Get the value of the string variable with the given name
| |
| getStyle | back to summary |
|---|---|
| public SStyle getStyle() Get the style used to render citation items and bibliographies
| |
| getTerm | back to summary |
|---|---|
| public String getTerm(String name) Get the singular long form of a term | |
| getTerm | back to summary |
|---|---|
| public String getTerm(String name, boolean plural) Get the long form of a term | |
| getTerm | back to summary |
|---|---|
| public String getTerm(String name, LTerm. Get the singular form of a term | |
| getTerm | back to summary |
|---|---|
| public String getTerm(String name, LTerm. Get a term | |
| getVariable | back to summary |
|---|---|
| public Object getVariable(String name) Get the value of a string, date, or name variable
| |
| getVariable | back to summary |
|---|---|
| public Object getVariable(String name, boolean ignoreListeners) Get the value of a string, date, or name variable
| |
| getVariableListeners | back to summary |
|---|---|
| public Set Get the set of variable listeners
| |
| removeVariableListener | back to summary |
|---|---|
| public void removeVariableListener(VariableListener listener) Removes a variable listener from this context
| |
| reset | back to summary |
|---|---|
| public void reset() Reset the render context so it can be used to render another citation | |
| setLastLabelRendered | back to summary |
|---|---|
| public void setLastLabelRendered(SLabel label) Save the last label rendered
| |
| suppressVariable | back to summary |
|---|---|
| public void suppressVariable(String name) Add a variable to the set of suppressed variables. Suppressed variables
should not be rendered any more for the rest of the output. The context
will pretend the variable's value is
| |