本文整理汇总了Java中org.apache.commons.digester.Digester.addFactoryCreate方法的典型用法代码示例。如果您正苦于以下问题:Java Digester.addFactoryCreate方法的具体用法?Java Digester.addFactoryCreate怎么用?Java Digester.addFactoryCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.digester.Digester
的用法示例。
在下文中一共展示了Digester.addFactoryCreate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTextInputComponentRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
public static void addTextInputComponentRules(Digester digester)
{
String componentNamespace = digester.getRuleNamespaceURI();
String textInputComponentPattern = "*/componentElement/textInput";
// digester.addObjectCreate(textInputComponentPattern, TextInputComponent.class.getName());
digester.addFactoryCreate(textInputComponentPattern, TextInputComponentFactory.class.getName());
digester.addSetProperties(textInputComponentPattern);
// digester.addSetProperties(textInputComponentPattern,
// //properties to be ignored by this rule
// new String[]{JRXmlConstants.ATTRIBUTE_evaluationTime, StandardBarbecueComponent.PROPERTY_ROTATION},
// new String[0]);
digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE);
digester.addFactoryCreate(textInputComponentPattern + "/textField", TextInputTextFieldFactory.class.getName());
digester.setRuleNamespaceURI(componentNamespace);
}
示例2: setPieChartRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected void setPieChartRules(Digester digester)
{
String pieChartPattern = "*/componentElement/pieChart";
digester.addFactoryCreate(pieChartPattern, PieChartXmlFactory.class.getName());
String pieDatasetPattern = pieChartPattern + "/pieDataset";
digester.addObjectCreate(pieDatasetPattern, DesignPieDataset.class.getName());
digester.addSetNext(pieDatasetPattern, "setDataset", PieDataset.class.getName());
String keyExpressionPattern = pieDatasetPattern + "/keyExpression";
digester.addFactoryCreate(keyExpressionPattern, JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(keyExpressionPattern, "setText", 0);
digester.addSetNext(keyExpressionPattern, "setKeyExpression", JRExpression.class.getName());
String valueExpressionPattern = pieDatasetPattern + "/valueExpression";
digester.addFactoryCreate(valueExpressionPattern, JRExpressionFactory.NumberExpressionFactory.class.getName());
digester.addCallMethod(valueExpressionPattern, "setText", 0);
digester.addSetNext(valueExpressionPattern, "setValueExpression", JRExpression.class.getName());
String titleExpressionPattern = pieChartPattern + "/titleExpression";
digester.addFactoryCreate(titleExpressionPattern, JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(titleExpressionPattern, "setText", 0);
digester.addSetNext(titleExpressionPattern, "setTitleExpression", JRExpression.class.getName());
}
示例3: addBarcodeRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected <T> void addBarcodeRules(Digester digester,
String barcodePattern, Class<T> barcodeComponentClass,
String[] ignoredProperties)
{
digester.addObjectCreate(barcodePattern, barcodeComponentClass);
digester.addSetProperties(barcodePattern,
//properties to be ignored by this rule
ignoredProperties,
new String[0]);
//rule to set evaluation time
digester.addRule(barcodePattern,
new XmlConstantPropertyRule(
JRXmlConstants.ATTRIBUTE_evaluationTime, "evaluationTimeValue",
EvaluationTimeEnum.values()));
String codeExpressionPattern = barcodePattern + "/codeExpression";
digester.addFactoryCreate(codeExpressionPattern,
JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(codeExpressionPattern, "setText", 0);
digester.addSetNext(codeExpressionPattern, "setCodeExpression",
JRExpression.class.getName());
}
示例4: addItemRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
protected void addItemRules(Digester digester, String itemPattern, String namespace)
{
digester.addFactoryCreate(itemPattern, ItemXmlFactory.class.getName());
digester.addSetNext(itemPattern, "addItem", Item.class.getName());
String locationItemPropertyPattern = itemPattern + "/itemProperty";
digester.addFactoryCreate(locationItemPropertyPattern, ItemPropertyXmlFactory.class.getName());
digester.addSetNext(locationItemPropertyPattern, "addItemProperty", ItemProperty.class.getName());
digester.setRuleNamespaceURI(namespace);
String locationItemPropertyValueExpressionPattern = locationItemPropertyPattern + "/" + JRXmlConstants.ELEMENT_valueExpression;
digester.addFactoryCreate(locationItemPropertyValueExpressionPattern, JRExpressionFactory.class.getName());
digester.addCallMethod(locationItemPropertyValueExpressionPattern, "setText", 0);
digester.addSetNext(locationItemPropertyValueExpressionPattern, "setValueExpression", JRExpression.class.getName());
}
示例5: addSortComponentRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
public static void addSortComponentRules(Digester digester)
{
String componentNamespace = digester.getRuleNamespaceURI();
String sortComponentPattern = "*/componentElement/sort";
digester.addObjectCreate(sortComponentPattern, SortComponent.class.getName());
digester.addSetProperties(sortComponentPattern, new String[] {
SortComponent.PROPERTY_EVALUATION_TIME,
},
new String[0]);
digester.addRule(sortComponentPattern,
new XmlConstantPropertyRule(
SortComponent.PROPERTY_EVALUATION_TIME,
EvaluationTimeEnum.values()));
digester.addFactoryCreate(sortComponentPattern + "/symbol", SortComponentSymbolFactory.class.getName());
digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE);
digester.addFactoryCreate(sortComponentPattern + "/symbol/font", SortComponentSymbolFontFactory.class.getName());
digester.addSetNext(sortComponentPattern + "/symbol/font", "setSymbolFont", JRFont.class.getName());
digester.setRuleNamespaceURI(componentNamespace);
}
示例6: configureToolEventsDefDigester
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
public static Digester configureToolEventsDefDigester(String prefix, Digester digester) {
// root
digester.addObjectCreate(prefix + "toolEventsDef", ArrayList.class );
// tool tag
ToolFactoryImpl toolFactory = new ToolFactoryImpl();
digester.addFactoryCreate(prefix + "toolEventsDef/tool", toolFactory);
digester.addBeanPropertySetter(prefix + "toolEventsDef/tool/toolId", "toolId" );
digester.addBeanPropertySetter(prefix + "toolEventsDef/tool/additionalToolIds", "additionalToolIdsStr" );
digester.addBeanPropertySetter(prefix + "toolEventsDef/tool/selected", "selected" );
digester.addSetNext(prefix + "toolEventsDef/tool", "add" );
// event tag
EventFactoryImpl eventFactoryImpl = new EventFactoryImpl();
digester.addFactoryCreate(prefix + "toolEventsDef/tool/event", eventFactoryImpl);
digester.addBeanPropertySetter(prefix + "toolEventsDef/tool/event/eventId", "eventId" );
digester.addBeanPropertySetter(prefix + "toolEventsDef/tool/event/selected", "selected" );
digester.addBeanPropertySetter(prefix + "toolEventsDef/tool/event/anonymous", "anonymous" );
digester.addSetNext(prefix + "toolEventsDef/tool/event", "addEvent" );
return digester;
}
示例7: addTemplateRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected void addTemplateRules(Digester digester, String barcodePattern)
{
String templateExpressionPattern = barcodePattern + "/templateExpression";
digester.addFactoryCreate(templateExpressionPattern,
JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(templateExpressionPattern, "setText", 0);
digester.addSetNext(templateExpressionPattern, "setTemplateExpression",
JRExpression.class.getName());
}
示例8: setBarChartRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected void setBarChartRules(Digester digester)
{
String barChartPattern = "*/componentElement/barChart";
digester.addFactoryCreate(barChartPattern, BarChartXmlFactory.class.getName());
String titleExpressionPattern = barChartPattern + "/titleExpression";
digester.addFactoryCreate(titleExpressionPattern, JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(titleExpressionPattern, "setText", 0);
digester.addSetNext(titleExpressionPattern, "setTitleExpression", JRExpression.class.getName());
String barDatasetPattern = barChartPattern + "/barDataset";
digester.addObjectCreate(barDatasetPattern, DesignBarDataset.class.getName());
digester.addSetNext(barDatasetPattern, "setDataset", BarDataset.class.getName());
String barSeriesPattern = barDatasetPattern + "/barSeries";
digester.addObjectCreate(barSeriesPattern, DefaultBarSeries.class.getName());
digester.addSetNext(barSeriesPattern, "addSeries", BarSeries.class.getName());
String seriesExpressionPattern = barSeriesPattern + "/seriesExpression";
digester.addFactoryCreate(seriesExpressionPattern, JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(seriesExpressionPattern, "setText", 0);
digester.addSetNext(seriesExpressionPattern, "setSeriesExpression", JRExpression.class.getName());
String categoryExpressionPattern = barSeriesPattern + "/categoryExpression";
digester.addFactoryCreate(categoryExpressionPattern, JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(categoryExpressionPattern, "setText", 0);
digester.addSetNext(categoryExpressionPattern, "setCategoryExpression", JRExpression.class.getName());
String valueExpressionPattern = barSeriesPattern + "/valueExpression";
digester.addFactoryCreate(valueExpressionPattern, JRExpressionFactory.NumberExpressionFactory.class.getName());
digester.addCallMethod(valueExpressionPattern, "setText", 0);
digester.addSetNext(valueExpressionPattern, "setValueExpression", JRExpression.class.getName());
}
示例9: setHtmlComponentRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
protected void setHtmlComponentRules(Digester digester)
{
String htmlComponentPattern = "*/componentElement/html";
digester.addObjectCreate(htmlComponentPattern, HtmlComponent.class.getName());
digester.addSetProperties(htmlComponentPattern, new String[] {
HtmlComponent.PROPERTY_SCALE_TYPE,
HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
HtmlComponent.PROPERTY_VERTICAL_ALIGN,
HtmlComponent.PROPERTY_EVALUATION_TIME },
new String[0]);
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_SCALE_TYPE,
ScaleImageEnum.values()));
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
"horizontalImageAlign",
HorizontalImageAlignEnum.values()));
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_VERTICAL_ALIGN,
"verticalImageAlign",
VerticalImageAlignEnum.values()));
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_EVALUATION_TIME,
EvaluationTimeEnum.values()));
String htmlContentPattern = htmlComponentPattern + "/htmlContentExpression";
digester.addFactoryCreate(htmlContentPattern, JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(htmlContentPattern, "setText", 0);
digester.addSetNext(htmlContentPattern, "setHtmlContentExpression", JRExpression.class.getName());
}
示例10: addSubreportRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
protected void addSubreportRules(Digester digester)
{
String subreportPattern = "*/part/subreportPart";
digester.addObjectCreate(subreportPattern, StandardSubreportPartComponent.class);
digester.addSetProperties(subreportPattern);
String partNamespace = digester.getRuleNamespaceURI();
String jrNamespace = JRXmlConstants.JASPERREPORTS_NAMESPACE;
digester.setRuleNamespaceURI(jrNamespace);
String paramMapExpressionPattern = subreportPattern + "/parametersMapExpression";
digester.addFactoryCreate(paramMapExpressionPattern,
JRExpressionFactory.class.getName());
digester.addCallMethod(paramMapExpressionPattern, "setText", 0);
digester.addSetNext(paramMapExpressionPattern, "setParametersMapExpression",
JRExpression.class.getName());
/* */
digester.addFactoryCreate("*/subreportPart/subreportParameter", JRSubreportParameterFactory.class.getName());
digester.addSetNext("*/subreportPart/subreportParameter", "addParameter", JRSubreportParameter.class.getName());
/* */
digester.addFactoryCreate("*/subreportPart/subreportParameter/subreportParameterExpression", JRExpressionFactory.class.getName());
digester.addSetNext("*/subreportPart/subreportParameter/subreportParameterExpression", "setExpression", JRExpression.class.getName());
digester.addCallMethod("*/subreportPart/subreportParameter/subreportParameterExpression", "setText", 0);
/* */
digester.addFactoryCreate("*/subreportPart/returnValue", JRSubreportReturnValueFactory.class.getName());
digester.addSetNext("*/subreportPart/returnValue", "addReturnValue", JRSubreportReturnValue.class.getName());
String subreportExpressionPattern = subreportPattern + "/subreportExpression";
digester.addFactoryCreate(subreportExpressionPattern,
JRExpressionFactory.class.getName());
digester.addCallMethod(subreportExpressionPattern, "setText", 0);
digester.addSetNext(subreportExpressionPattern, "setExpression",
JRExpression.class.getName());
digester.setRuleNamespaceURI(partNamespace);
}
示例11: addPartComponentRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
protected static void addPartComponentRules(JasperReportsContext jasperReportsContext, Digester digester)
{
digester.addFactoryCreate("*/part", JRPartFactory.class.getName());
digester.addRule("*/part", new UuidPropertyRule("uuid", "UUID"));
digester.addSetNext("*/part", "addPart", JRPart.class.getName());
addExpressionRules(digester, "*/part/" + JRXmlConstants.ELEMENT_partNameExpression, "setPartNameExpression");
Collection<PartComponentsBundle> components = PartComponentsEnvironment.getInstance(jasperReportsContext).getBundles();
for (Iterator<PartComponentsBundle> it = components.iterator(); it.hasNext();)
{
PartComponentsBundle componentsBundle = it.next();
ComponentsXmlParser xmlParser = componentsBundle.getXmlParser();
digester.setRuleNamespaceURI(xmlParser.getNamespace());
XmlDigesterConfigurer configurer = xmlParser.getDigesterConfigurer();
if (configurer != null)
{
configurer.configureDigester(digester);
}
digester.setRuleNamespaceURI(xmlParser.getNamespace());
for (Iterator<String> namesIt = componentsBundle.getComponentNames().iterator();
namesIt.hasNext();)
{
String componentName = namesIt.next();
digester.addRule("*/part/" + componentName,
JRPartComponentRule.newInstance());
}
}
digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE);
}
示例12: addTemplateRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
protected static void addTemplateRules(Digester digester)
{
String templatePattern = JRXmlConstants.ELEMENT_jasperReport + "/" + JRXmlConstants.ELEMENT_template;
//do not change the order
digester.addObjectCreate(templatePattern, JRDesignReportTemplate.class);
digester.addSetNext(templatePattern, "addTemplate", JRReportTemplate.class.getName());
@SuppressWarnings("deprecation")
Class<?> lcDepStringExprFactoryClass = JRStringExpressionFactory.class;
digester.addFactoryCreate(templatePattern, lcDepStringExprFactoryClass);
digester.addCallMethod(templatePattern, "setText", 0);
digester.addSetNext(templatePattern, "setSourceExpression", JRExpression.class.getName());
}
示例13: addDatasetRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
private static void addDatasetRules(Digester digester)
{
String subDatasetPattern = "jasperReport/" + JRXmlConstants.ELEMENT_subDataset;
digester.addFactoryCreate(subDatasetPattern, JRDatasetFactory.class.getName());
digester.addSetNext(subDatasetPattern, "addDataset", JRDesignDataset.class.getName());
String datasetRunPattern = "*/" + JRXmlConstants.ELEMENT_datasetRun;
digester.addFactoryCreate(datasetRunPattern, JRDatasetRunFactory.class.getName());
digester.addSetNext(datasetRunPattern, "setDatasetRun", JRDatasetRun.class.getName());
String datasetParamPattern = datasetRunPattern + "/" + JRXmlConstants.ELEMENT_datasetParameter;
digester.addFactoryCreate(datasetParamPattern, JRDatasetRunParameterFactory.class.getName());
digester.addSetNext(datasetParamPattern, "addParameter", JRDatasetParameter.class.getName());
String datasetParamExprPattern = datasetParamPattern + "/" + JRXmlConstants.ELEMENT_datasetParameterExpression;
digester.addFactoryCreate(datasetParamExprPattern, JRExpressionFactory.class.getName());
digester.addSetNext(datasetParamExprPattern, "setExpression", JRExpression.class.getName());
digester.addCallMethod(datasetParamExprPattern, "setText", 0);
String returnValuePattern = datasetRunPattern + "/" + JRXmlConstants.ELEMENT_returnValue;
digester.addObjectCreate(returnValuePattern, DesignReturnValue.class.getName());
digester.addSetProperties(returnValuePattern,
new String[]{JRXmlConstants.ATTRIBUTE_incrementerFactoryClass, JRXmlConstants.ATTRIBUTE_calculation},
new String[]{"incrementerFactoryClassName"});
digester.addRule(returnValuePattern, new XmlConstantPropertyRule(
JRXmlConstants.ATTRIBUTE_calculation, CalculationEnum.values()));
digester.addSetNext(returnValuePattern, "addReturnValue");
}
示例14: addFrameRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
private static void addFrameRules(Digester digester)
{
String framePattern = "*/" + JRXmlConstants.ELEMENT_frame;
digester.addFactoryCreate(framePattern, JRFrameFactory.class.getName());
digester.addSetNext(framePattern, "addElement", JRDesignElement.class.getName());
digester.addRule(framePattern, new XmlConstantPropertyRule(JRXmlConstants.ATTRIBUTE_borderSplitType, BorderSplitType.values()));
}
示例15: addHyperlinkParameterRules
import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
private static void addHyperlinkParameterRules(Digester digester)
{
String hyperlinkParameterPattern = "*/" + JRXmlConstants.ELEMENT_hyperlinkParameter;
digester.addFactoryCreate(hyperlinkParameterPattern, JRHyperlinkParameterFactory.class.getName());
digester.addSetNext(hyperlinkParameterPattern, "addHyperlinkParameter", JRHyperlinkParameter.class.getName());
String hyperlinkParameterExpressionPattern = hyperlinkParameterPattern + '/' + JRXmlConstants.ELEMENT_hyperlinkParameterExpression;
@SuppressWarnings("deprecation")
Class<?> lcDepStringExprFactoryClass = JRStringExpressionFactory.class;
digester.addFactoryCreate(hyperlinkParameterExpressionPattern, lcDepStringExprFactoryClass.getName());
digester.addSetNext(hyperlinkParameterExpressionPattern, "setValueExpression", JRExpression.class.getName());
digester.addCallMethod(hyperlinkParameterExpressionPattern, "setText", 0);
}