Top Description Fields Constructors Methods
de.undercouch.citeproc.csl.internal.behavior

public Class TextCase

extends Object
implements Behavior
Class Inheritance
All Implemented Interfaces
de.undercouch.citeproc.csl.internal.behavior.Behavior, java.util.function.BiConsumer
Imports
de.undercouch.citeproc.csl.internal.RenderContext, de.undercouch.citeproc.csl.internal.token.TextToken, .Token, de.undercouch.citeproc.helper.NodeHelper, .StringHelper, org.apache.commons.lang3.StringUtils, org.apache.commons.text.WordUtils, org.w3c.dom.Node, java.util.function.Consumer

Wraps around a render function and transforms its result in terms of text case (uppercase, lowercas, capitalize, etc.).
Author
Michel Kraemer

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
TextCase(Node
the XML node
node
)

Parses an XML node and determines what kind of transformation to apply

Method Summary

Modifier and TypeMethod and Description
public void
accept(Consumer<RenderContext> renderFunction, RenderContext ctx)

Implements java.util.function.BiConsumer.accept.

Performs this operation on the given arguments.

public String

Returns:

the transformed string
applyTo
(String
the string to transform
s
,
RenderContext
the current render context
ctx
)

Apply the text-case rules to the given string

private Token

Returns:

the new token with the transformed text
transform
(Token
the token
t
,
RenderContext
the current render context
ctx
)

Transforms the text of a token

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

textCaseback to summary
private final String textCase

Constructor Detail

TextCaseback to summary
public TextCase(Node node)

Parses an XML node and determines what kind of transformation to apply

Parameters
node:Node

the XML node

Method Detail

acceptback to summary
public void accept(Consumer<RenderContext> renderFunction, RenderContext ctx)

Implements java.util.function.BiConsumer.accept.

Doc from java.util.function.BiConsumer.accept.

Performs this operation on the given arguments.

Annotations
@Override
applyToback to summary
public String applyTo(String s, RenderContext ctx)

Apply the text-case rules to the given string

Parameters
s:String

the string to transform

ctx:RenderContext

the current render context

Returns:String

the transformed string

transformback to summary
private Token transform(Token t, RenderContext ctx)

Transforms the text of a token

Parameters
t:Token

the token

ctx:RenderContext

the current render context

Returns:Token

the new token with the transformed text