Java Code Examples for org.apache.commons.digester3.Digester#addCallParam()

The following examples show how to use org.apache.commons.digester3.Digester#addCallParam() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TagmeConfig.java    From tagme with Apache License 2.0 6 votes vote down vote up
protected static void setRules(Digester d)
{
	d.addObjectCreate("tagme", Config.class);

	d.addCallMethod("tagme/logConfiguration", "setLoggingFilePath", 0);
	d.addCallMethod("tagme/stopword", "setStopwordDir", 0);
	d.addCallMethod("tagme/repository", "setRepositoryDir", 0);

	d.addCallMethod("tagme/inits/class", "addInit", 0);
	d.addCallMethod("tagme/langs/lang", "addLang", 0);

	d.addObjectCreate("tagme/setting", ParamSetting.class);
	d.addSetNext("tagme/setting", "addSetting", ParamSetting.class.getName());
	d.addCallMethod("tagme/setting", "setName", 1);
	d.addCallParam("tagme/setting", 0, "name");

	d.addCallMethod("tagme/setting/param", "addParam", 2);
	d.addCallParam("tagme/setting/param", 0, "name");
	d.addCallParam("tagme/setting/param", 1, "value");

}
 
Example 2
Source File: NotificationHubDescription.java    From azure-notificationhubs-java-backend with Apache License 2.0 6 votes vote down vote up
private static void setupSingleEntryParser(Digester digester){
	digester.addObjectCreate("*/entry", NotificationHubDescription.class);
	digester.addCallMethod("*/entry/title","setPath",1);
	digester.addCallParam("*/entry/title",0);
	digester.addObjectCreate("*/ApnsCredential", ApnsCredential.class);
	digester.addObjectCreate("*/AdmCredential", AdmCredential.class);
	digester.addObjectCreate("*/WnsCredential", WindowsCredential.class);
	digester.addObjectCreate("*/MpnsCredential", MpnsCredential.class);
	digester.addObjectCreate("*/GcmCredential", GcmCredential.class);
	digester.addObjectCreate("*/FcmCredential", FcmCredential.class);
	digester.addObjectCreate("*/BaiduCredential", BaiduCredential.class);
	PnsCredential.setupDigister(digester);
	digester.addSetNext("*/ApnsCredential", "setApnsCredential", ApnsCredential.class.getName());
	digester.addSetNext("*/AdmCredential", "setAdmCredential", AdmCredential.class.getName());
	digester.addSetNext("*/WnsCredential", "setWindowsCredential", WindowsCredential.class.getName());
	digester.addSetNext("*/MpnsCredential", "setMpnsCredential", MpnsCredential.class.getName());
	digester.addSetNext("*/GcmCredential", "setGcmCredential", GcmCredential.class.getName());
	digester.addSetNext("*/FcmCredential", "setFcmCredential", FcmCredential.class.getName());
	digester.addSetNext("*/BaiduCredential", "setBaiduCredential", BaiduCredential.class.getName());
}
 
Example 3
Source File: NotificationHubJob.java    From azure-notificationhubs-java-backend with Apache License 2.0 6 votes vote down vote up
private static void setupSingleEntryParser(Digester digester){
	digester.addObjectCreate("*/entry", NotificationHubJob.class);
	digester.addCallMethod("*/JobId", "setJobId",1);
	digester.addCallParam("*/JobId", 0);
	digester.addCallMethod("*/Progress", "setProgressFromString",1);
	digester.addCallParam("*/Progress", 0);
	digester.addCallMethod("*/Type", "setJobTypeFromString",1);
	digester.addCallParam("*/Type", 0);
	digester.addCallMethod("*/Status", "setJobStatusFromString",1);
	digester.addCallParam("*/Status", 0);
	digester.addCallMethod("*/OutputContainerUri", "setOutputContainerUri",1);
	digester.addCallParam("*/OutputContainerUri", 0);
	digester.addCallMethod("*/ImportFileUri", "setImportFileUri",1);
	digester.addCallParam("*/ImportFileUri", 0);
	digester.addCallMethod("*/Failure", "setFailure",1);
	digester.addCallParam("*/Failure", 0);
	digester.addCallMethod("*/CreatedAt", "setCreatedAtFromString",1);
	digester.addCallParam("*/CreatedAt", 0);
	digester.addCallMethod("*/UpdatedAt", "setUpdatedAtFromString",1);
	digester.addCallParam("*/UpdatedAt", 0);		
	digester.addObjectCreate("*/OutputProperties", HashMap.class);
	digester.addCallMethod("*/d3p1:KeyValueOfstringstring", "put",2);
	digester.addCallParam("*/d3p1:Key", 0);
	digester.addCallParam("*/d3p1:Value", 1);
	digester.addSetNext("*/OutputProperties", "setOutputProperties", Map.class.getName());
}
 
Example 4
Source File: GoPluginBundleDescriptorParser.java    From gocd with Apache License 2.0 5 votes vote down vote up
static GoPluginBundleDescriptor parseXML(InputStream pluginXML,
                                         String pluginJarFileLocation,
                                         File pluginBundleLocation,
                                         boolean isBundledPlugin) throws IOException, SAXException {
    Digester digester = initDigester();

    GoPluginBundleDescriptorParser parserForThisXML = new GoPluginBundleDescriptorParser(pluginJarFileLocation, pluginBundleLocation, isBundledPlugin);
    digester.push(parserForThisXML);

    digester.addCallMethod("gocd-bundle", "createBundle", 1);
    digester.addCallParam("gocd-bundle", 0, "version");

    digester.addCallMethod("gocd-bundle/plugins/plugin", "createPlugin", 1);
    digester.addCallParam("gocd-bundle/plugins/plugin", 0, "id");

    digester.addCallMethod("gocd-bundle/plugins/plugin/about", "createAbout", 4);
    digester.addCallParam("gocd-bundle/plugins/plugin/about/name", 0);
    digester.addCallParam("gocd-bundle/plugins/plugin/about/version", 1);
    digester.addCallParam("gocd-bundle/plugins/plugin/about/target-go-version", 2);
    digester.addCallParam("gocd-bundle/plugins/plugin/about/description", 3);

    digester.addCallMethod("gocd-bundle/plugins/plugin/about/vendor", "createVendor", 2);
    digester.addCallParam("gocd-bundle/plugins/plugin/about/vendor/name", 0);
    digester.addCallParam("gocd-bundle/plugins/plugin/about/vendor/url", 1);

    digester.addCallMethod("gocd-bundle/plugins/plugin/about/target-os/value", "addTargetOS", 1);
    digester.addCallParam("gocd-bundle/plugins/plugin/about/target-os/value", 0);

    digester.addCallMethod("gocd-bundle/plugins/plugin/extensions/extension", "addExtension", 1);
    digester.addCallParam("gocd-bundle/plugins/plugin/extensions/extension", 0, "class");

    digester.parse(pluginXML);

    return parserForThisXML.descriptor;
}
 
Example 5
Source File: GoPluginDescriptorParser.java    From gocd with Apache License 2.0 5 votes vote down vote up
static GoPluginBundleDescriptor parseXML(InputStream pluginXML,
                                         String pluginJarFileLocation,
                                         File pluginBundleLocation,
                                         boolean isBundledPlugin) throws IOException, SAXException {
    Digester digester = initDigester();
    GoPluginDescriptorParser parserForThisXML = new GoPluginDescriptorParser(pluginJarFileLocation, pluginBundleLocation, isBundledPlugin);
    digester.push(parserForThisXML);

    digester.addCallMethod("go-plugin", "createPlugin", 2);
    digester.addCallParam("go-plugin", 0, "id");
    digester.addCallParam("go-plugin", 1, "version");

    digester.addCallMethod("go-plugin/about", "createAbout", 4);
    digester.addCallParam("go-plugin/about/name", 0);
    digester.addCallParam("go-plugin/about/version", 1);
    digester.addCallParam("go-plugin/about/target-go-version", 2);
    digester.addCallParam("go-plugin/about/description", 3);

    digester.addCallMethod("go-plugin/about/vendor", "createVendor", 2);
    digester.addCallParam("go-plugin/about/vendor/name", 0);
    digester.addCallParam("go-plugin/about/vendor/url", 1);

    digester.addCallMethod("go-plugin/about/target-os/value", "addTargetOS", 1);
    digester.addCallParam("go-plugin/about/target-os/value", 0);

    digester.parse(pluginXML);

    return parserForThisXML.descriptor;
}
 
Example 6
Source File: PnsCredential.java    From azure-notificationhubs-java-backend with Apache License 2.0 4 votes vote down vote up
public static void setupDigister(Digester digester){
	digester.addCallMethod("*/Property", "setProperty",2);
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Value", 1);
}
 
Example 7
Source File: Registration.java    From azure-notificationhubs-java-backend with Apache License 2.0 4 votes vote down vote up
private static void addRegistrationRules(Digester digester) {
	digester.addFactoryCreate("*/RegistrationDescription",
			new Registration.RegistrationCreationFactory());
	digester.addObjectCreate("*/WindowsRegistrationDescription",
			WindowsRegistration.class);
	digester.addObjectCreate("*/WindowsTemplateRegistrationDescription",
			WindowsTemplateRegistration.class);
	digester.addObjectCreate("*/AppleRegistrationDescription",
			AppleRegistration.class);
	digester.addObjectCreate("*/AppleTemplateRegistrationDescription",
			AppleTemplateRegistration.class);
	digester.addObjectCreate("*/GcmRegistrationDescription",
			GcmRegistration.class);
	digester.addObjectCreate("*/GcmTemplateRegistrationDescription",
			GcmTemplateRegistration.class);
	digester.addObjectCreate("*/FcmRegistrationDescription",
			FcmRegistration.class);
	digester.addObjectCreate("*/FcmTemplateRegistrationDescription",
			FcmTemplateRegistration.class);
	digester.addObjectCreate("*/MpnsRegistrationDescription",
			MpnsRegistration.class);
	digester.addObjectCreate("*/MpnsTemplateRegistrationDescription",
			MpnsTemplateRegistration.class);
	digester.addObjectCreate("*/AdmRegistrationDescription",
			AdmRegistration.class);
	digester.addObjectCreate("*/AdmTemplateRegistrationDescription",
			AdmTemplateRegistration.class);
	digester.addObjectCreate("*/BaiduRegistrationDescription",
			BaiduRegistration.class);
	digester.addObjectCreate("*/BaiduTemplateRegistrationDescription",
			BaiduTemplateRegistration.class);
	digester.addCallMethod("*/RegistrationId", "setRegistrationId", 1);
	digester.addCallParam("*/RegistrationId", 0);
	digester.addCallMethod("*/ETag", "setEtag", 1);
	digester.addCallParam("*/ETag", 0);
	digester.addCallMethod("*/ChannelUri", "setChannelUri", 1);
	digester.addCallParam("*/ChannelUri", 0);
	digester.addCallMethod("*/DeviceToken", "setDeviceToken", 1);
	digester.addCallParam("*/DeviceToken", 0);
	digester.addCallMethod("*/GcmRegistrationId", "setGcmRegistrationId", 1);
	digester.addCallParam("*/GcmRegistrationId", 0);
	digester.addCallMethod("*/FcmRegistrationId", "setFcmRegistrationId", 1);
	digester.addCallParam("*/FcmRegistrationId", 0);
	digester.addCallMethod("*/Tags", "setTagsFromString", 1);
	digester.addCallParam("*/Tags", 0);
	digester.addCallMethod("*/BodyTemplate", "setBodyTemplate", 1);
	digester.addCallParam("*/BodyTemplate", 0);
	digester.addCallMethod("*/WnsHeader", "addHeader", 2);
	digester.addCallParam("*/WnsHeader/Header", 0);
	digester.addCallParam("*/WnsHeader/Value", 1);
	digester.addCallMethod("*/MpnsHeader", "addHeader", 2);
	digester.addCallParam("*/MpnsHeader/Header", 0);
	digester.addCallParam("*/MpnsHeader/Value", 1);
	digester.addCallMethod("*/Expiry", "setExpiry", 1);
	digester.addCallParam("*/Expiry", 0);
	digester.addCallMethod("*/ExpirationTime", "setExpirationTimeFromString", 1);
	digester.addCallParam("*/ExpirationTime", 0);
	digester.addCallMethod("*/AdmRegistrationId", "setAdmRegistrationId", 1);
	digester.addCallParam("*/AdmRegistrationId", 0);
	digester.addCallMethod("*/BaiduUserId", "setBaiduUserId", 1);
	digester.addCallParam("*/BaiduUserId", 0);
	digester.addCallMethod("*/BaiduChannelId", "setBaiduChannelId", 1);
	digester.addCallParam("*/BaiduChannelId", 0);
}
 
Example 8
Source File: NotificationTelemetry.java    From azure-notificationhubs-java-backend with Apache License 2.0 4 votes vote down vote up
private static void setupParser(Digester digester){
	digester.addObjectCreate("*/NotificationDetails", NotificationTelemetry.class);
	digester.addCallMethod("*/NotificationId", "setNotificationId",1);
	digester.addCallParam("*/NotificationId", 0);
	digester.addCallMethod("*/Location", "setLocation",1);
	digester.addCallParam("*/Location", 0);
	digester.addCallMethod("*/State", "setNotificationStatusFromString",1);
	digester.addCallParam("*/State", 0);
	digester.addCallMethod("*/EnqueueTime", "setEnqueueTimeFromString",1);
	digester.addCallParam("*/EnqueueTime", 0);
	digester.addCallMethod("*/StartTime", "setStartTimeFromString",1);
	digester.addCallParam("*/StartTime", 0);
	digester.addCallMethod("*/EndTime", "setEndTimeFromString",1);
	digester.addCallParam("*/EndTime", 0);
	digester.addCallMethod("*/NotificationBody", "setNotificationBody",1);
	digester.addCallParam("*/NotificationBody", 0);
	digester.addCallMethod("*/TargetPlatforms", "setTargetPlatforms",1);
	digester.addCallParam("*/TargetPlatforms", 0);
	digester.addCallMethod("*/PnsErrorDetailsUri", "setPnsErrorDetailsUri",1);
	digester.addCallParam("*/PnsErrorDetailsUri", 0);
	
	digester.addObjectCreate("*/ApnsOutcomeCounts", HashMap.class);		
	digester.addCallMethod("*/Outcome", "put",2, new Class[]{String.class, Integer.class} );
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Count", 1);
	digester.addSetNext("*/ApnsOutcomeCounts", "setApnsOutcomeCounts", Map.class.getName());
	
	digester.addObjectCreate("*/MpnsOutcomeCounts", HashMap.class);		
	digester.addCallMethod("*/Outcome", "put",2, new Class[]{String.class, Integer.class} );
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Count", 1);
	digester.addSetNext("*/MpnsOutcomeCounts", "setMpnsOutcomeCounts", Map.class.getName());
	
	digester.addObjectCreate("*/WnsOutcomeCounts", HashMap.class);		
	digester.addCallMethod("*/Outcome", "put",2, new Class[]{String.class, Integer.class} );
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Count", 1);
	digester.addSetNext("*/WnsOutcomeCounts", "setWnsOutcomeCounts", Map.class.getName());
	
	digester.addObjectCreate("*/GcmOutcomeCounts", HashMap.class);		
	digester.addCallMethod("*/Outcome", "put",2, new Class[]{String.class, Integer.class} );
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Count", 1);
	digester.addSetNext("*/GcmOutcomeCounts", "setGcmOutcomeCounts", Map.class.getName());
	
	digester.addObjectCreate("*/FcmOutcomeCounts", HashMap.class);		
	digester.addCallMethod("*/Outcome", "put",2, new Class[]{String.class, Integer.class} );
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Count", 1);
	digester.addSetNext("*/FcmOutcomeCounts", "setFcmOutcomeCounts", Map.class.getName());

	digester.addObjectCreate("*/AdmOutcomeCounts", HashMap.class);		
	digester.addCallMethod("*/Outcome", "put",2, new Class[]{String.class, Integer.class} );
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Count", 1);
	digester.addSetNext("*/AdmOutcomeCounts", "setAdmOutcomeCounts", Map.class.getName());

	digester.addObjectCreate("*/BaiduOutcomeCounts", HashMap.class);		
	digester.addCallMethod("*/Outcome", "put",2, new Class[]{String.class, Integer.class} );
	digester.addCallParam("*/Name", 0);
	digester.addCallParam("*/Count", 1);
	digester.addSetNext("*/BaiduOutcomeCounts", "setBaiduOutcomeCounts", Map.class.getName());
}