當前位置: 首頁>>代碼示例>>Java>>正文


Java Digester.setRuleNamespaceURI方法代碼示例

本文整理匯總了Java中org.apache.commons.digester.Digester.setRuleNamespaceURI方法的典型用法代碼示例。如果您正苦於以下問題:Java Digester.setRuleNamespaceURI方法的具體用法?Java Digester.setRuleNamespaceURI怎麽用?Java Digester.setRuleNamespaceURI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.digester.Digester的用法示例。


在下文中一共展示了Digester.setRuleNamespaceURI方法的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);
	}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:22,代碼來源:TextInputComponentDigester.java

示例2: 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);
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:27,代碼來源:SortComponentDigester.java

示例3: 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());
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:17,代碼來源:ComponentsXmlDigesterConfigurer.java

示例4: addExpressionRules

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected <T> void addExpressionRules(Digester digester, String expressionPattern,
		Class<T> factoryClass, String setterMethod, boolean jrNamespace)
{
	String originalNamespace = digester.getRuleNamespaceURI();
	if (jrNamespace)
	{
		digester.setRuleNamespaceURI(JRXmlWriter.JASPERREPORTS_NAMESPACE.getNamespaceURI());
	}
	
	digester.addFactoryCreate(expressionPattern, factoryClass);
	digester.addCallMethod(expressionPattern, "setText", 0);
	digester.addSetNext(expressionPattern, setterMethod,
			JRExpression.class.getName());
	
	if (jrNamespace)
	{
		digester.setRuleNamespaceURI(originalNamespace);
	}
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:20,代碼來源:ComponentsXmlDigesterConfigurer.java

示例5: addEventDigesterRules

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected static void addEventDigesterRules(Digester digester)
{
  // Java Enterprise 5.0
  // digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee");

  // Maven Faces Plugin
  digester.setRuleNamespaceURI("http://myfaces.apache.org/maven-faces-plugin");

  // faces-config/faces-config-extension/event
  digester.addObjectCreate("faces-config/faces-config-extension/event", EventBean.class);
  digester.addBeanPropertySetter("faces-config/faces-config-extension/event/description");
  digester.addBeanPropertySetter("faces-config/faces-config-extension/event/event-type",
                                 "eventType");
  digester.addBeanPropertySetter("faces-config/faces-config-extension/event/event-class",
                                 "eventClass");
  digester.addBeanPropertySetter("faces-config/faces-config-extension/event/event-listener-class",
                                 "eventListenerClass");
  digester.addBeanPropertySetter("faces-config/faces-config-extension/event/event-source-interface",
                                 "eventSourceInterface");
  digester.addSetNext("faces-config/faces-config-extension/event", "addEvent",
                      EventBean.class.getName());
}
 
開發者ID:alessandroleite,項目名稱:maven-jdev-plugin,代碼行數:23,代碼來源:FacesConfigParser.java

示例6: 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);
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:41,代碼來源:PartComponentsXmlDigesterConfigurer.java

示例7: addComponentRules

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected static void addComponentRules(JasperReportsContext jasperReportsContext, Digester digester)
{
	digester.addFactoryCreate("*/componentElement", JRComponentElementFactory.class.getName());
	digester.addSetNext("*/componentElement", "addElement", JRDesignElement.class.getName());
	
	Collection<ComponentsBundle> components = ComponentsEnvironment.getInstance(jasperReportsContext).getBundles();
	for (Iterator<ComponentsBundle> it = components.iterator(); it.hasNext();)
	{
		ComponentsBundle 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("*/componentElement/" + componentName, 
					JRComponentRule.newInstance());
		}
	}
	
	digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE);
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:31,代碼來源:JRXmlDigesterFactory.java

示例8: 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);
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:34,代碼來源:JRXmlDigesterFactory.java

示例9: configureDigester

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected void configureDigester(JasperReportsContext jasperReportsContext, Digester digester) throws SAXException, ParserConfigurationException 
{
	digester.setNamespaceAware(true);
	digester.setRuleNamespaceURI(JRXmlConstants.JASPERTEMPLATE_NAMESPACE);
	
	boolean validating = JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(JRReportSaxParserFactory.COMPILER_XML_VALIDATION);
	
	digester.setErrorHandler(this);
	digester.setValidating(validating);
	digester.setFeature("http://xml.org/sax/features/validation", validating);

	digester.addRuleSet(rules);
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:14,代碼來源:JRXmlTemplateDigesterFactory.java

示例10: addIconLabelComponentRules

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
public static void addIconLabelComponentRules(Digester digester)
{
	String componentNamespace = digester.getRuleNamespaceURI();
	
	String iconLabelComponentPattern = "*/componentElement/iconLabel";
	digester.addFactoryCreate(iconLabelComponentPattern, IconLabelComponentFactory.class.getName());

	digester.addSetProperties(iconLabelComponentPattern, new String[] {
			IconLabelComponent.PROPERTY_ICON_POSITION,
			IconLabelComponent.PROPERTY_LABEL_FILL,
			IconLabelComponent.PROPERTY_HORIZONTAL_ALIGNMENT,
			IconLabelComponent.PROPERTY_VERTICAL_ALIGNMENT }, 
			new String[0]);
	
	digester.addRule(iconLabelComponentPattern, 
			new XmlConstantPropertyRule(
					IconLabelComponent.PROPERTY_ICON_POSITION,
					IconPositionEnum.values()));
	digester.addRule(iconLabelComponentPattern, 
			new XmlConstantPropertyRule(
					IconLabelComponent.PROPERTY_LABEL_FILL,
					ContainerFillEnum.values()));
	digester.addRule(iconLabelComponentPattern, 
			new XmlConstantPropertyRule(
					IconLabelComponent.PROPERTY_HORIZONTAL_ALIGNMENT,
					"horizontalImageAlign",
					HorizontalImageAlignEnum.values()));
	digester.addRule(iconLabelComponentPattern, 
			new XmlConstantPropertyRule(
					IconLabelComponent.PROPERTY_VERTICAL_ALIGNMENT,
					"verticalImageAlign",
					VerticalImageAlignEnum.values()));
	
	digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE);

	digester.addFactoryCreate(iconLabelComponentPattern + "/label/textField", LabelTextFieldFactory.class.getName());
	digester.addFactoryCreate(iconLabelComponentPattern + "/icon/textField", IconTextFieldFactory.class.getName());

	digester.setRuleNamespaceURI(componentNamespace);
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:41,代碼來源:IconLabelComponentDigester.java

示例11: addRenderKitDigesterRules

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected static void addRenderKitDigesterRules(Digester digester)
{
  // Java Enterprise 5.0
  digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee");

  // faces-config/render-kit
  digester.addObjectCreate("faces-config/render-kit", RenderKitBean.class);
  digester.addBeanPropertySetter("faces-config/render-kit/render-kit-id",
                                 "renderKitId");
  digester.addSetNext("faces-config/render-kit", "addRenderKit",
                      RenderKitBean.class.getName());

  // faces-config/render-kit/renderer
  digester.addObjectCreate("faces-config/render-kit/renderer", RendererBean.class);
  digester.addBeanPropertySetter("faces-config/render-kit/renderer/description");
  digester.addBeanPropertySetter("faces-config/render-kit/renderer/component-family",
                                 "componentFamily");
  digester.addBeanPropertySetter("faces-config/render-kit/renderer/renderer-type",
                                 "rendererType");
  digester.addBeanPropertySetter("faces-config/render-kit/renderer/renderer-class",
                                 "rendererClass");
  digester.addSetNext("faces-config/render-kit/renderer", "addRenderer",
                      RendererBean.class.getName());

  // Maven Faces Plugin
  digester.setRuleNamespaceURI("http://myfaces.apache.org/maven-faces-plugin");

  // faces-config/render-kit/renderer/renderer-extension
  digester.addBeanPropertySetter("faces-config/render-kit/renderer/renderer-extension/component-type",
                                 "componentType");
  digester.addBeanPropertySetter("faces-config/render-kit/renderer/renderer-extension/renderer-superclass",
                                 "rendererSuperclass");
}
 
開發者ID:alessandroleite,項目名稱:maven-jdev-plugin,代碼行數:34,代碼來源:FacesConfigParser.java

示例12: execute

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
 * Installs a module description in the target OpenCms. Module description
 * comes from the path given in the parameter configurationXml. The XML file
 * there contains module description(s) in the format as in WEB-INF/config/opencms-modules.xml
 * or manifest.xml of an exported module. It may contain multiple modules,
 * but it must be well formed, say, in case of multiple modules it must have one root node
 * containing the module entries. These module configuration(s) get added to
 * WEB-INF/config/opencms-modules.xml of the target installation.
 * Module content gets sync'ed and published afterwards by the respective plugin goals.
 *
 * @param webappDirectory
 *            path to WEB-INF of the OpenCms installation
 * @param adminPassword
 *            password of user "Admin" performing the operation
 * @param moduleSourcePath
 *            path to module xml configuration file
 * @throws CmsException
 *             if anything OpenCms goes wrong
 * @throws IOException
 *             in case configuration files cannot be read
 * @throws SAXException
 *             in case configuration files cannot be parsed
 */
public final void execute(final String webappDirectory,
    final String adminPassword, final String moduleSourcePath, final String moduleVersion)
    throws IOException, CmsException, SAXException {
    final String webinfdir = webappDirectory + File.separatorChar +
        "WEB-INF";
    final CmOpenCmsShell cmsshell = CmOpenCmsShell.getInstance(webinfdir,
            "Admin", adminPassword);

    this.moduleVersion = moduleVersion;
    
    if (cmsshell != null) {
        this.cms = cmsshell.getCmsObject();

        final CmsRequestContext requestcontext = this.cms.getRequestContext();
        requestcontext.setCurrentProject(this.cms.readProject("Offline"));
        
        this.setReport(new CmsShellReport(requestcontext.getLocale()));
        
        // code taken from org.opencms.module.CmsModuleImportExportHandler (readModuleFromImport)
        final Digester digester = new Digester();
        digester.setUseContextClassLoader(true);
        digester.setValidating(false);
        digester.setRuleNamespaceURI(null);
        digester.setErrorHandler(new CmsXmlErrorHandler());
        digester.push(this);
        CmsModuleXmlHandler.addXmlDigesterRules(digester);
        
        simpleReport("Parsing module file: "+moduleSourcePath+". Version: "+moduleVersion);            
        digester.parse(new FileInputStream(new File(moduleSourcePath)));
        simpleReport("End of parsing module file: "+moduleSourcePath+". Version: "+moduleVersion);
    }else{
    	System.err.println("[WARN]VfsModule.execute(): CmsShell not available");
    }
}
 
開發者ID:comundus,項目名稱:vfs-maven-plugin,代碼行數:58,代碼來源:VfsModule.java

示例13: getDigester

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected static Digester getDigester() {

		Digester digester = new Digester();

		digester.setValidating(false);

		digester.addObjectCreate("rss", RSS.class);
		digester.addSetProperties("rss");

		digester.addObjectCreate("rss/channel", Channel.class);
		digester.addSetProperties("rss/channel");
		digester.addCallMethod("rss/channel/title", "setTitle", 0);
		digester.addSetNext("rss/channel", "addChannel");

		digester.addObjectCreate("rss/channel/item", Item.class);
		digester.addSetProperties("rss/channel/item");
		digester.addCallMethod("rss/channel/item/title", "setTitle", 0);
		digester.addCallMethod("rss/channel/item/guid", "setGuid", 0);
		digester.addCallMethod("rss/channel/item/link", "setLink", 0);
		digester.addCallMethod("rss/channel/item/description", "setDescription", 0);
		digester.addCallMethod("rss/channel/item/author", "setAuthor", 0);
		digester.addCallMethod("rss/channel/item/pubDate", "setPubDate", 0);
		digester.addCallMethod("rss/channel/item/category", "addCategory", 1);
		digester.addCallParam("rss/channel/item/category", 0);
		digester.addSetNext("rss/channel/item", "addItem");

		digester.addObjectCreate("rss/channel/item/enclosure", Enclosure.class);
		digester.addSetProperties("rss/channel/item/enclosure");
		digester.addSetNext("rss/channel/item/enclosure", "addEnclosure");

		digester.setNamespaceAware(true);

		digester.setRuleNamespaceURI("http://purl.org/rss/1.0/modules/content/");
		// some feeds use <content:encoded> for their HTML
		digester.addCallMethod("rss/channel/item/encoded", "setDescription", 0);

		return digester;
	}
 
開發者ID:bmunzenb,項目名稱:feed-buddy,代碼行數:39,代碼來源:RSSParser.java

示例14: addMapRules

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected void addMapRules(Digester digester) {
  String mapPattern = "*/componentElement/wmsmap";
  digester.addFactoryCreate(mapPattern, WmsMapXmlFactory.class);

  String bboxExpressionPattern = mapPattern + "/bboxExpression";
  digester.addFactoryCreate(bboxExpressionPattern,
      JRExpressionFactory.class.getName());
  digester.addCallMethod(bboxExpressionPattern, "setText", 0);
  digester.addSetNext(bboxExpressionPattern, "setBBoxExpression",
      JRExpression.class.getName());

  String layersExpressionPattern = mapPattern + "/layersExpression";
  digester.addFactoryCreate(layersExpressionPattern,
      JRExpressionFactory.class.getName());
  digester.addCallMethod(layersExpressionPattern, "setText", 0);
  digester.addSetNext(layersExpressionPattern, "setLayersExpression",
      JRExpression.class.getName());

  String stylesExpressionPattern = mapPattern + "/stylesExpression";
  digester.addFactoryCreate(stylesExpressionPattern,
      JRExpressionFactory.class.getName());
  digester.addCallMethod(stylesExpressionPattern, "setText", 0);
  digester.addSetNext(stylesExpressionPattern, "setStylesExpression",
      JRExpression.class.getName());

  String urlParametersExpressionPattern = mapPattern
      + "/urlParametersExpression";
  digester.addFactoryCreate(urlParametersExpressionPattern,
      JRExpressionFactory.class.getName());
  digester.addCallMethod(urlParametersExpressionPattern, "setText", 0);
  digester.addSetNext(urlParametersExpressionPattern,
      "setUrlParametersExpression", JRExpression.class.getName());

  String componentNamespace = digester.getRuleNamespaceURI();

  // leave the digester namespace in the same state
  digester.setRuleNamespaceURI(componentNamespace);
}
 
開發者ID:sourcepole,項目名稱:jasperreports-wms-component,代碼行數:39,代碼來源:WmsMapComponentsXmlDigesterConfigurer.java

示例15: addSpiderChartRules

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public static void addSpiderChartRules(Digester digester)
{
	String componentNamespace = digester.getRuleNamespaceURI();
	String jrNamespace = JRXmlConstants.JASPERREPORTS_NAMESPACE;
	
	String spiderChartPattern = "*/componentElement/spiderChart";
	digester.addFactoryCreate(spiderChartPattern, SpiderChartXmlFactory.class.getName());
	
	String chartSettingsPattern = spiderChartPattern + "/chartSettings";
	digester.addFactoryCreate(chartSettingsPattern, ChartSettingsXmlFactory.class.getName());
	digester.addSetNext(chartSettingsPattern, "setChartSettings", ChartSettings.class.getName());

	digester.setRuleNamespaceURI(jrNamespace);
	String chartTitlePattern = chartSettingsPattern + "/chartTitle";
	digester.addFactoryCreate(chartTitlePattern, ChartSettingsXmlFactory.ChartTitleFactory.class.getName());
	digester.addFactoryCreate(chartTitlePattern + "/font", JRFontFactory.ChartFontFactory.class.getName());
	digester.addSetNext(chartTitlePattern + "/font", "setTitleFont", JRFont.class.getName());
	digester.addFactoryCreate(chartTitlePattern + "/titleExpression", JRExpressionFactory.StringExpressionFactory.class);
	digester.addSetNext(chartTitlePattern + "/titleExpression", "setTitleExpression", JRDesignExpression.class.getName());
	digester.addCallMethod(chartTitlePattern + "/titleExpression", "setText", 0);
	
	String chartSubtitlePattern = chartSettingsPattern + "/chartSubtitle";
	digester.addFactoryCreate(chartSubtitlePattern, ChartSettingsXmlFactory.ChartSubtitleFactory.class.getName());
	digester.addFactoryCreate(chartSubtitlePattern + "/font", JRFontFactory.ChartFontFactory.class.getName());
	digester.addSetNext(chartSubtitlePattern + "/font", "setSubtitleFont", JRFont.class.getName());
	digester.addFactoryCreate(chartSubtitlePattern + "/subtitleExpression", JRExpressionFactory.StringExpressionFactory.class);
	digester.addSetNext(chartSubtitlePattern + "/subtitleExpression", "setSubtitleExpression", JRDesignExpression.class.getName());
	digester.addCallMethod(chartSubtitlePattern + "/subtitleExpression", "setText", 0);
	
	digester.addFactoryCreate(chartSettingsPattern + "/chartLegend", ChartSettingsXmlFactory.ChartLegendFactory.class.getName());
	digester.addFactoryCreate(chartSettingsPattern + "/chartLegend/font", JRFontFactory.ChartFontFactory.class.getName());
	digester.addSetNext(chartSettingsPattern + "/chartLegend/font", "setLegendFont", JRFont.class.getName());

	digester.setRuleNamespaceURI(componentNamespace);
	String spiderDatasetPattern = spiderChartPattern + "/spiderDataset";
	digester.addFactoryCreate(spiderDatasetPattern, SpiderDatasetXmlFactory.class.getName());
	digester.addSetNext(spiderDatasetPattern, "setDataset", SpiderDataset.class.getName());
	
	digester.setRuleNamespaceURI(jrNamespace);
	String datasetPattern = spiderDatasetPattern + "/dataset";
	digester.addFactoryCreate(datasetPattern, JRElementDatasetFactory.class.getName());

	String datasetIncrementWhenExpressionPath = datasetPattern + JRXmlConstants.ELEMENT_incrementWhenExpression;
	digester.addFactoryCreate(datasetIncrementWhenExpressionPath, JRExpressionFactory.BooleanExpressionFactory.class.getName());
	digester.addSetNext(datasetIncrementWhenExpressionPath, "setIncrementWhenExpression", JRExpression.class.getName());
	digester.addCallMethod(datasetIncrementWhenExpressionPath, "setText", 0);

	String seriesPattern = spiderDatasetPattern + "/categorySeries";
	digester.addFactoryCreate(seriesPattern, JRCategorySeriesFactory.class.getName());
	digester.addSetNext(seriesPattern, "addCategorySeries", JRDesignCategorySeries.class.getName());

	digester.addFactoryCreate(seriesPattern + "/seriesExpression", JRExpressionFactory.ComparableExpressionFactory.class);
	digester.addSetNext(seriesPattern + "/seriesExpression", "setSeriesExpression", JRDesignExpression.class.getName());
	digester.addCallMethod(seriesPattern + "/seriesExpression", "setText", 0);
	digester.addFactoryCreate(seriesPattern + "/categoryExpression", JRExpressionFactory.ComparableExpressionFactory.class);
	digester.addSetNext(seriesPattern + "/categoryExpression", "setCategoryExpression", JRDesignExpression.class.getName());
	digester.addCallMethod(seriesPattern + "/categoryExpression", "setText", 0);
	digester.addFactoryCreate(seriesPattern + "/labelExpression", JRExpressionFactory.StringExpressionFactory.class);
	digester.addSetNext(seriesPattern + "/labelExpression", "setLabelExpression", JRDesignExpression.class.getName());
	digester.addCallMethod(seriesPattern + "/labelExpression", "setText", 0);
	digester.addFactoryCreate(seriesPattern + "/valueExpression", JRExpressionFactory.NumberExpressionFactory.class);
	digester.addSetNext(seriesPattern + "/valueExpression", "setValueExpression", JRDesignExpression.class.getName());
	digester.addCallMethod(seriesPattern + "/valueExpression", "setText", 0);
	
	digester.setRuleNamespaceURI(componentNamespace);
	String plotPattern = spiderChartPattern + "/spiderPlot";
	digester.addFactoryCreate(plotPattern, SpiderPlotXmlFactory.class.getName());
	digester.addSetNext(plotPattern, "setPlot", SpiderPlot.class.getName());

	digester.setRuleNamespaceURI(jrNamespace);
	String labelFontPattern = plotPattern + "/labelFont/font";
	digester.addFactoryCreate(labelFontPattern, JRFontFactory.ChartFontFactory.class.getName());
	digester.addSetNext(labelFontPattern, "setLabelFont", JRFont.class.getName());

	digester.setRuleNamespaceURI(componentNamespace);
	String maxValueExpressionPattern = plotPattern + "/maxValueExpression";
	digester.addFactoryCreate(maxValueExpressionPattern, JRExpressionFactory.DoubleExpressionFactory.class);
	digester.addSetNext(maxValueExpressionPattern, "setMaxValueExpression", JRDesignExpression.class.getName() );
	digester.addCallMethod(maxValueExpressionPattern, "setText", 0 );
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:82,代碼來源:SpiderChartDigester.java


注:本文中的org.apache.commons.digester.Digester.setRuleNamespaceURI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。