本文整理汇总了Java中net.sf.jasperreports.engine.design.JRDesignExpression.setValueClassName方法的典型用法代码示例。如果您正苦于以下问题:Java JRDesignExpression.setValueClassName方法的具体用法?Java JRDesignExpression.setValueClassName怎么用?Java JRDesignExpression.setValueClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.design.JRDesignExpression
的用法示例。
在下文中一共展示了JRDesignExpression.setValueClassName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createObject
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
JRDesignExpression expression = new JRDesignExpression();
String className = atts.getValue(JRXmlConstants.ATTRIBUTE_class);
if (className == null)
{
expression.setValueClass(java.lang.String.class);
}
else
{
expression.setValueClassName(className);
}
return expression;
}
示例2: createObject
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
JRDesignExpression expression = new JRDesignExpression();
String value = atts.getValue(JRXmlConstants.ATTRIBUTE_class);
if (value != null)
{
// being backward compatible
if(value.equals("dori.jasper.engine.JasperReport"))
{
value = JasperReport.class.getName();
}
expression.setValueClassName(value);
}
else
{
expression.setValueClass(java.lang.String.class);
}
return expression;
}
示例3: createObject
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
JRDesignVariable variable = (JRDesignVariable)digester.peek();
JRDesignExpression expression = new JRDesignExpression();
if (
variable.getCalculationValue() == CalculationEnum.COUNT
|| variable.getCalculationValue() == CalculationEnum.DISTINCT_COUNT
)
{
expression.setValueClassName(java.lang.Object.class.getName());
}
else
{
expression.setValueClassName(variable.getValueClassName());
}
return expression;
}
示例4: createObject
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public Object createObject(Attributes attributes)
{
JRDesignCrosstabMeasure measure = (JRDesignCrosstabMeasure) digester.peek();
JRDesignExpression expression = new JRDesignExpression();
if (
measure.getCalculationValue() == CalculationEnum.COUNT
|| measure.getCalculationValue() == CalculationEnum.DISTINCT_COUNT
)
{
expression.setValueClassName(Object.class.getName());
}
else
{
expression.setValueClassName(measure.getValueClassName());
}
return expression;
}
示例5: setValues
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static <T extends JRExpression> T setValues(T e, Object value, String valueClassName) {
if (value == null)
return null;
String text = "";
JRDesignExpression expr = (JRDesignExpression) e;
expr = createExpression(expr);
if (value instanceof JRDesignExpression) {
return checkEmpty((T) value);
} else if (value instanceof String) {
text = (String) value;
}
expr.setText(text);
if (valueClassName != null)
expr.setValueClassName(valueClassName);
return checkEmpty((T) expr);
}
示例6: createExpression
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
/**
* Create a JRDesignExpression by specifying the expression text. An optional value class name can be used as
* expression class. Value class name should be specified only if strictly required, since it is deprecated by
* JasperReports.
*
* @param text
* - The text of the expression, or null for empty expressions
* @param valueClassName
* - A string representing the class returned by the expression
*
* @return a new JRDesignExpression
*/
@SuppressWarnings("deprecation")
public static JRDesignExpression createExpression(String text, String valueClassName) {
JRDesignExpression exp = new JRDesignExpression();
if (text != null) {
exp.setText(text);
}
if (valueClassName != null) {
exp.setValueClassName(valueClassName);
}
return exp;
}
示例7: createObject
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
JRDesignVariable variable = (JRDesignVariable)digester.peek();
JRDesignExpression expression = new JRDesignExpression();
expression.setValueClassName(variable.getValueClassName());
return expression;
}
示例8: createObject
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
JRDesignParameter parameter = (JRDesignParameter)digester.peek();
JRDesignExpression expression = new JRDesignExpression();
expression.setValueClassName(parameter.getValueClassName());
return expression;
}
示例9: createObject
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public Object createObject( Attributes attrs ){
JRDesignExpression expression = new JRDesignExpression();
expression.setValueClassName( String.class.getName() );
ExpressionTypeEnum type = ExpressionTypeEnum.getByName(attrs.getValue(JRXmlConstants.ATTRIBUTE_type));
if (type != null)
{
expression.setType(type);
}
return expression;
}
示例10: createJRElement
import net.sf.jasperreports.engine.design.JRDesignExpression; //导入方法依赖的package包/类
@Override
public JRDesignElement createJRElement(JasperDesign jasperDesign) {
JRDesignComponentElement el = new JRDesignComponentElement();
HtmlComponent component = new HtmlComponent();
JRDesignExpression exp = new JRDesignExpression();
exp.setValueClassName("java.lang.String"); //$NON-NLS-1$
exp.setText("\"<p style='background-color:yellow;'>HTML paragraph</p>\""); //$NON-NLS-1$
component.setHtmlContentExpression(exp);
el.setComponent(component);
el.setComponentKey(new ComponentKey(
"http://jasperreports.sourceforge.net/htmlcomponent", "hc", "html")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return el;
}