final String type)
throws FunctionEvaluationException
{
if (value instanceof CSSValue)
{
throw new FunctionEvaluationException();
}
if (value instanceof String)
{
final String strVal = (String) value;
if ("length".equals(type))
{
final CSSNumericValue cssNumericValue = FunctionUtilities.parseNumberValue(strVal);
return new StaticTextToken(cssNumericValue.getCSSText());
}
else if ("url".equals(type))
{
final CSSResourceValue cssResourceValue = FunctionUtilities.loadResource(layoutProcess, strVal);
final Resource resource = cssResourceValue.getValue();
return new ResourceContentToken(resource);
}
else if ("color".equals(type))
{
final CSSValue colorValue = ColorUtil.parseColor(strVal);
if (colorValue == null)
{
throw new FunctionEvaluationException();
}
return new StaticTextToken(colorValue.getCSSText());
}
else
{