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

public Class SDatePart

extends Object
implements SElement
Class Inheritance
All Implemented Interfaces
de.undercouch.citeproc.csl.internal.SElement
Imports
de.undercouch.citeproc.csl.internal.RenderContext, .SElement, de.undercouch.citeproc.csl.internal.behavior.Affixes, .StripPeriods, de.undercouch.citeproc.csl.internal.locale.LTerm, de.undercouch.citeproc.helper.NodeHelper, org.apache.commons.lang3.StringUtils, org.w3c.dom.Node, java.util.Objects

A date-part element from a style file
Author
Michel Kraemer

Field Summary

Modifier and TypeField and Description
private final Affixes
private int[]
private final String
private final String
private final String
private final StripPeriods

Constructor Summary

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

Creates the date-part element from an XML node

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name
getName
()

Get the name of the date part to render (i.e. year, month, or day)

public String

Returns:

the delimiter (never null)
getRangeDelimiter
()

Get the delimiter to use to express ranges between this date part and another one with the same name (i.e. between two years, two months, or two days).

public void
private String
renderDay(int day)

private void
private String
renderMonth(int month, RenderContext ctx)

private String
renderYear(int year, RenderContext ctx)

public void
setDate(int[]
the date
date
)

Set the date to render

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

affixesback to summary
private final Affixes affixes
dateback to summary
private int[] date
formback to summary
private final String form
nameback to summary
private final String name
rangeDelimiterback to summary
private final String rangeDelimiter
stripPeriodsback to summary
private final StripPeriods stripPeriods

Constructor Detail

SDatePartback to summary
public SDatePart(Node node)

Creates the date-part element from an XML node

Parameters
node:Node

the XML node

Method Detail

getNameback to summary
public String getName()

Get the name of the date part to render (i.e. year, month, or day)

Returns:String

the name

getRangeDelimiterback to summary
public String getRangeDelimiter()

Get the delimiter to use to express ranges between this date part and another one with the same name (i.e. between two years, two months, or two days). The default delimiter is an en-dash.

Returns:String

the delimiter (never null)

renderback to summary
public void render(RenderContext ctx)

Implements de.undercouch.citeproc.csl.internal.SElement.render.

Doc from de.undercouch.citeproc.csl.internal.SElement.render.

Renders the element

Annotations
@Override
renderDayback to summary
private String renderDay(int day)
renderInternalback to summary
private void renderInternal(RenderContext ctx)
renderMonthback to summary
private String renderMonth(int month, RenderContext ctx)
renderYearback to summary
private String renderYear(int year, RenderContext ctx)
setDateback to summary
public void setDate(int[] date)

Set the date to render

Parameters
date:int[]

the date