Top Inners Fields Constructors Methods
com.openhtmltopdf.context

public Class ContentFunctionFactory

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, org.w3c.dom.Element, com.openhtmltopdf.css.constants.IdentValue, com.openhtmltopdf.css.extend.ContentFunction, com.openhtmltopdf.css.parser.CSSPrimitiveValue, .FSFunction, .PropertyValue, com.openhtmltopdf.layout.CounterFunction, .InlineBoxing, .LayoutContext, com.openhtmltopdf.render.Box, .InlineLayoutBox, .InlineText, .LineBox, .RenderingContext

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ContentFunctionFactory.FsIfCutOffFunction

Content function which returns its argument if on a cut off page, else the empty string.

private static class
ContentFunctionFactory.LeaderFunction

Partially implements leaders as specified here: http://www.w3.org/TR/2007/WD-css3-gcpm-20070504/#leaders

private static class
private abstract static class
private static class
private static class
ContentFunctionFactory.TargetCounterFunction

Partially implements target counter as specified here: http://www.w3.org/TR/2007/WD-css3-gcpm-20070504/#cross-references

private static class

Field Summary

Modifier and TypeField and Description
private final List<ContentFunction>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ContentFunction
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_functionsback to summary
private final List<ContentFunction> _functions

Constructor Detail

ContentFunctionFactoryback to summary
public ContentFunctionFactory()

Method Detail

lookupFunctionback to summary
public ContentFunction lookupFunction(LayoutContext c, FSFunction function)
registerFunctionback to summary
public void registerFunction(ContentFunction function)
com.openhtmltopdf.context back to summary

private Class ContentFunctionFactory.FsIfCutOffFunction

extends Object
implements ContentFunction
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.context.ContentFunctionFactory.FsIfCutOffFunction
All Implemented Interfaces
com.openhtmltopdf.css.extend.ContentFunction

Content function which returns its argument if on a cut off page, else the empty string. Example: content: "Page " counter(page) -fs-if-cut-off(" continued") " of " counter(pages);

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public String
public boolean
public String
getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

public boolean
isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FsIfCutOffFunctionback to summary
private FsIfCutOffFunction()

Method Detail

calculateback to summary
public String calculate(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
calculateback to summary
public String calculate(RenderingContext c, FSFunction function, InlineText text)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
canHandleback to summary
public boolean canHandle(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.canHandle.

Annotations
@Override
getLayoutReplacementTextback to summary
public String getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

Doc from com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

Annotations
@Override
isStaticback to summary
public boolean isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Doc from com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time. If true, calculate(LayoutContext, FSFunction) will be called. If false, calculate(RenderingContext, FSFunction, InlineText) will be called.

Annotations
@Override
com.openhtmltopdf.context back to summary

private Class ContentFunctionFactory.LeaderFunction

extends Object
implements ContentFunction
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.context.ContentFunctionFactory.LeaderFunction
All Implemented Interfaces
com.openhtmltopdf.css.extend.ContentFunction

Partially implements leaders as specified here: http://www.w3.org/TR/2007/WD-css3-gcpm-20070504/#leaders

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public String
public boolean
public String
getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

public boolean
isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LeaderFunctionback to summary
private LeaderFunction()

Method Detail

calculateback to summary
public String calculate(RenderingContext c, FSFunction function, InlineText text)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
calculateback to summary
public String calculate(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
canHandleback to summary
public boolean canHandle(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.canHandle.

Annotations
@Override
getLayoutReplacementTextback to summary
public String getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

Doc from com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

Annotations
@Override
isStaticback to summary
public boolean isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Doc from com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time. If true, calculate(LayoutContext, FSFunction) will be called. If false, calculate(RenderingContext, FSFunction, InlineText) will be called.

Annotations
@Override
com.openhtmltopdf.context back to summary

private Class ContentFunctionFactory.PageCounterFunction

extends PageNumberFunction
implements ContentFunction
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.css.extend.ContentFunction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public boolean
Inherited from com.openhtmltopdf.context.ContentFunctionFactory.PageNumberFunction:
calculategetLayoutReplacementTextgetListStyleTypeisCounterisStatic

Constructor Detail

PageCounterFunctionback to summary
private PageCounterFunction()

Method Detail

calculateback to summary
public String calculate(RenderingContext c, FSFunction function, InlineText text)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
canHandleback to summary
public boolean canHandle(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.canHandle.

Annotations
@Override
com.openhtmltopdf.context back to summary

private abstract Class ContentFunctionFactory.PageNumberFunction

extends Object
implements ContentFunction
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.context.ContentFunctionFactory.PageNumberFunction
All Implemented Interfaces
com.openhtmltopdf.css.extend.ContentFunction
Known Direct Subclasses
com.openhtmltopdf.context.ContentFunctionFactory.PageCounterFunction, com.openhtmltopdf.context.ContentFunctionFactory.PagesCounterFunction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public String
getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

protected IdentValue
protected boolean
isCounter(FSFunction function, String counterName)

public boolean
isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PageNumberFunctionback to summary
private PageNumberFunction()

Method Detail

calculateback to summary
public String calculate(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
getLayoutReplacementTextback to summary
public String getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

Doc from com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

Annotations
@Override
getListStyleTypeback to summary
protected IdentValue getListStyleType(FSFunction function)
isCounterback to summary
protected boolean isCounter(FSFunction function, String counterName)
isStaticback to summary
public boolean isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Doc from com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time. If true, calculate(LayoutContext, FSFunction) will be called. If false, calculate(RenderingContext, FSFunction, InlineText) will be called.

Annotations
@Override
com.openhtmltopdf.context back to summary

private Class ContentFunctionFactory.PagesCounterFunction

extends PageNumberFunction
implements ContentFunction
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.css.extend.ContentFunction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public boolean
Inherited from com.openhtmltopdf.context.ContentFunctionFactory.PageNumberFunction:
calculategetLayoutReplacementTextgetListStyleTypeisCounterisStatic

Constructor Detail

PagesCounterFunctionback to summary
private PagesCounterFunction()

Method Detail

calculateback to summary
public String calculate(RenderingContext c, FSFunction function, InlineText text)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
canHandleback to summary
public boolean canHandle(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.canHandle.

Annotations
@Override
com.openhtmltopdf.context back to summary

private Class ContentFunctionFactory.TargetCounterFunction

extends Object
implements ContentFunction
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.context.ContentFunctionFactory.TargetCounterFunction
All Implemented Interfaces
com.openhtmltopdf.css.extend.ContentFunction

Partially implements target counter as specified here: http://www.w3.org/TR/2007/WD-css3-gcpm-20070504/#cross-references

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public String
public boolean
public String
getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

public boolean
isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TargetCounterFunctionback to summary
private TargetCounterFunction()

Method Detail

calculateback to summary
public String calculate(RenderingContext c, FSFunction function, InlineText text)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
calculateback to summary
public String calculate(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
canHandleback to summary
public boolean canHandle(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.canHandle.

Annotations
@Override
getLayoutReplacementTextback to summary
public String getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

Doc from com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

Annotations
@Override
isStaticback to summary
public boolean isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Doc from com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time. If true, calculate(LayoutContext, FSFunction) will be called. If false, calculate(RenderingContext, FSFunction, InlineText) will be called.

Annotations
@Override
com.openhtmltopdf.context back to summary

private Class ContentFunctionFactory.TargetTextFunction

extends Object
implements ContentFunction
Class Inheritance
  • java.lang.Object
  • com.openhtmltopdf.context.ContentFunctionFactory.TargetTextFunction
All Implemented Interfaces
com.openhtmltopdf.css.extend.ContentFunction

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
public String
public boolean
public String
getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

public boolean
isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TargetTextFunctionback to summary
private TargetTextFunction()

Method Detail

calculateback to summary
public String calculate(RenderingContext c, FSFunction function, InlineText text)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
calculateback to summary
public String calculate(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.calculate.

Annotations
@Override
canHandleback to summary
public boolean canHandle(LayoutContext c, FSFunction function)

Implements com.openhtmltopdf.css.extend.ContentFunction.canHandle.

Annotations
@Override
getLayoutReplacementTextback to summary
public String getLayoutReplacementText()

Implements com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

Doc from com.openhtmltopdf.css.extend.ContentFunction.getLayoutReplacementText.

If a function value can change at render time (i.e. isStatic() returns false) use this text as an approximation at layout.

Annotations
@Override
isStaticback to summary
public boolean isStatic()

Implements com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Doc from com.openhtmltopdf.css.extend.ContentFunction.isStatic.

Whether or not the function value can change at render time. If true, calculate(LayoutContext, FSFunction) will be called. If false, calculate(RenderingContext, FSFunction, InlineText) will be called.

Annotations
@Override