本文整理汇总了Java中org.apache.commons.digester3.Digester.addCallMethod方法的典型用法代码示例。如果您正苦于以下问题:Java Digester.addCallMethod方法的具体用法?Java Digester.addCallMethod怎么用?Java Digester.addCallMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.digester3.Digester
的用法示例。
在下文中一共展示了Digester.addCallMethod方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupSingleEntryParser
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
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("*/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("*/BaiduCredential", "setBaiduCredential", BaiduCredential.class.getName());
}
示例2: setupSingleEntryParser
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
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());
}
示例3: getPropertieSet
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
public static PropertieSet getPropertieSet() {
PropertieSet ps = null;
try {
Digester digester = new Digester();
digester.setValidating(false);
//digester.setNamespaceAware(true);
//String xsd = "" + new File("quickserver_config.xsd").toURI();
//digester.setSchema(xsd);
//nested QSAdminServer tag
String mainTag = "propertie-set";
String subTag = "propertie";
digester.addObjectCreate(mainTag, PropertieSet.class);
digester.addObjectCreate(mainTag+"/"+subTag, Propertie.class);
digester.addBeanPropertySetter(mainTag+"/"+subTag+"/name");
digester.addBeanPropertySetter(mainTag+"/"+subTag+"/command");
digester.addCallMethod(mainTag+"/"+subTag+"/get", "setGet",0);
digester.addCallMethod(mainTag+"/"+subTag+"/set", "setSet",0);
digester.addBeanPropertySetter(mainTag+"/"+subTag+"/type");
digester.addBeanPropertySetter(mainTag+"/"+subTag+"/desc");
digester.addBeanPropertySetter(mainTag+"/"+subTag+"/select");
digester.addBeanPropertySetter(mainTag+"/"+subTag+"/target-needed", "targetNeeded");
digester.addBeanPropertySetter(mainTag+"/"+subTag+"/version");
digester.addSetNext(mainTag+"/"+subTag,"addCommand");
URL configFile =
PropertieSet.class.getResource("/org/quickserver/net/qsadmin/gui/conf/PropertieSet.xml");
if(configFile==null)
throw new RuntimeException("XML File not found : "+"PropertieSet.xml");
InputStream input = configFile.openStream();
logger.fine("Loading command config from xml file : " + input);
ps = (PropertieSet) digester.parse(input);
} catch(Exception e) {
logger.severe("Could not init from xml file : " +e);
logger.fine("StackTrace:\n"+MyString.getStackTrace(e));
}
return ps;
}
示例4: build
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
/**
* Builds a Vocabulary from the supplied input stream
*
* @param is For the XML
* @return The extension
* @throws SAXException
* @throws IOException
* @throws ParserConfigurationException
*/
public Vocabulary build(InputStream is) throws IOException, SAXException, ParserConfigurationException {
Digester digester = new Digester(saxf.newSAXParser());
digester.setNamespaceAware(true);
digester.setXIncludeAware(false);
digester.setRuleNamespaceURI(VOCABULARY_NAMESPACE);
Vocabulary tv = new Vocabulary();
digester.push(tv);
// build the thesaurus
digester.addCallMethod("*/thesaurus", "setTitle", 1);
digester.addRule("*/thesaurus", new CallParamNoNSRule(0, "title"));
digester.addCallMethod("*/thesaurus", "setDescription", 1);
digester.addRule("*/thesaurus", new CallParamNoNSRule(0, "description"));
digester.addCallMethod("*/thesaurus", "setLink", 1);
digester.addRule("*/thesaurus", new CallParamNoNSRule(0, "relation"));
digester.addCallMethod("*/thesaurus", "setUri", 1);
digester.addRule("*/thesaurus", new CallParamNoNSRule(0, "URI"));
// build the concept
digester.addObjectCreate("*/concept", VocabularyConcept.class);
digester.addCallMethod("*/concept", "setLink", 1);
digester.addRule("*/concept", new CallParamNoNSRule(0, "relation"));
digester.addCallMethod("*/concept", "setDescription", 1);
digester.addRule("*/concept", new CallParamNoNSRule(0, "description"));
digester.addCallMethod("*/concept", "setUri", 1);
digester.addRule("*/concept", new CallParamNoNSRule(0, "URI"));
digester.addCallMethod("*/concept", "setIdentifier", 1);
digester.addRule("*/concept", new CallParamNoNSRule(0, "identifier"));
// build the terms
digester.addObjectCreate("*/preferred/term", VocabularyTerm.class);
VocabularyTerm t = new VocabularyTerm();
digester.addCallMethod("*/preferred/term", "setLang", 1);
digester.addRule("*/preferred/term", new CallParamNoNSRule(0, "lang"));
digester.addCallMethod("*/preferred/term", "setTitle", 1);
digester.addRule("*/preferred/term", new CallParamNoNSRule(0, "title"));
digester.addSetNext("*/preferred/term", "addPreferredTerm");
// build alternative terms
digester.addObjectCreate("*/alternative/term", VocabularyTerm.class);
VocabularyTerm talt = new VocabularyTerm();
digester.addCallMethod("*/alternative/term", "setLang", 1);
digester.addRule("*/alternative/term", new CallParamNoNSRule(0, "lang"));
digester.addCallMethod("*/alternative/term", "setTitle", 1);
digester.addRule("*/alternative/term", new CallParamNoNSRule(0, "title"));
digester.addSetNext("*/alternative/term", "addAlternativeTerm");
// add concept
digester.addSetNext("*/concept", "addConcept");
digester.parse(is);
return tv;
}
示例5: build
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
/**
* Builds an extension from the supplied input stream
*
* @param is For the XML
* @return The extension
* @throws SAXException
* @throws IOException
* @throws ParserConfigurationException
*/
public Extension build(InputStream is, URL url, boolean dev) throws IOException, SAXException, ParserConfigurationException {
// in order to deal with arbitrary namespace prefixes we need to parse namespace aware!
Digester digester = new Digester(saxf.newSAXParser());
digester.setRuleNamespaceURI(EXTENSION_NAMESPACE);
Extension e = new Extension(url, dev);
digester.push(e);
digester.addCallMethod("*/extension", "setTitle", 1);
digester.addRule("*/extension", new CallParamNoNSRule(0, "title"));
digester.addCallMethod("*/extension", "setName", 1);
digester.addCallParam("*/extension", 0, "name");
digester.addCallMethod("*/extension", "setNamespace", 1);
digester.addCallParam("*/extension", 0, "namespace");
digester.addCallMethod("*/extension", "setRowType", 1);
digester.addCallParam("*/extension", 0, "rowType");
digester.addCallMethod("*/extension", "setLink", 1);
digester.addRule("*/extension", new CallParamNoNSRule(0, "relation"));
digester.addCallMethod("*/extension", "setDescription", 1);
digester.addRule("*/extension", new CallParamNoNSRule(0, "description"));
digester.addCallMethod("*/extension", "setSubject", 1);
digester.addRule("*/extension", new CallParamNoNSRule(0, "subject"));
// build the properties
digester.addObjectCreate("*/property", ExtensionProperty.class);
digester.addCallMethod("*/property", "setQualname", 1);
digester.addCallParam("*/property", 0, "qualName");
digester.addCallMethod("*/property", "setName", 1);
digester.addCallParam("*/property", 0, "name");
digester.addCallMethod("*/property", "setNamespace", 1);
digester.addCallParam("*/property", 0, "namespace");
digester.addCallMethod("*/property", "setGroup", 1);
digester.addCallParam("*/property", 0, "group");
digester.addCallMethod("*/property", "setType", 1);
digester.addCallParam("*/property", 0, "type");
digester.addCallMethod("*/property", "setRequired", 1);
digester.addCallParam("*/property", 0, "required");
digester.addCallMethod("*/property", "setLink", 1);
digester.addRule("*/property", new CallParamNoNSRule(0, "relation"));
digester.addCallMethod("*/property", "setDescription", 1);
digester.addRule("*/property", new CallParamNoNSRule(0, "description"));
digester.addCallMethod("*/property", "setExamples", 1);
digester.addCallParam("*/property", 0, "examples");
digester.addCallMethod("*/property", "setColumnLength", 1);
digester.addCallParam("*/property", 0, "columnLength");
// This is a special rule that will use the url2ThesaurusMap
// to set the Vocabulary based on the attribute "thesaurus"
digester.addRule("*/property", thesaurusRule);
digester.addSetNext("*/property", "addProperty");
digester.parse(is);
return e;
}
示例6: setupDigister
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
public static void setupDigister(Digester digester){
digester.addCallMethod("*/Property", "setProperty",2);
digester.addCallParam("*/Name", 0);
digester.addCallParam("*/Value", 1);
}
示例7: addRegistrationRules
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
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("*/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("*/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);
}
示例8: setupParser
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
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("*/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());
}
示例9: addRegistrationRules
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
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("*/MpnsRegistrationDescription",
MpnsRegistration.class);
digester.addObjectCreate("*/MpnsTemplateRegistrationDescription",
MpnsTemplateRegistration.class);
digester.addObjectCreate("*/AdmRegistrationDescription",
AdmRegistration.class);
digester.addObjectCreate("*/AdmTemplateRegistrationDescription",
AdmTemplateRegistration.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("*/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);
}
示例10: createServerList
import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
/**
* Creates the rules.
*
* @return The rules all put into a rule chain
*/
private LinkedList createServerList(File data) throws Exception {
Digester digester = new Digester();
digester.setUseContextClassLoader(true);
// Construct server list
digester.addObjectCreate("config", LinkedList.class);
// Create servers
digester.addObjectCreate("config/server", null, "className");
digester.addSetProperties("config/server");
// Create rule
digester.addObjectCreate("config/server/rule", null, "className");
digester.addSetProperties("config/server/rule");
digester.addSetNext("config/server/rule", "setRule");
// Create composite rule
digester.addObjectCreate("config/server/composite-rule", null,
"className");
digester.addSetProperties("config/server/composite-rule");
digester.addObjectCreate("config/server/composite-rule/rule", null,
"className");
digester.addSetProperties("config/server/composite-rule/rule");
digester.addSetNext("config/server/composite-rule/rule", "addRule");
digester.addSetNext("config/server/composite-rule", "setRule");
// Add server to list
digester.addSetNext("config/server", "add");
// Create cluster servers
digester.addObjectCreate("config/cluster-server", null, "className");
digester.addSetProperties("config/cluster-server");
// Create the servers in this cluster
digester.addCallMethod("config/cluster-server/server", "addServer", 2);
digester.addCallParam("config/cluster-server/server", 0, "domainName");
digester.addCallParam("config/cluster-server/server", 1, "path");
// Create rule
digester.addObjectCreate("config/cluster-server/rule", null,
"className");
digester.addSetProperties("config/cluster-server/rule");
digester.addSetNext("config/cluster-server/rule", "setRule");
// Create composite rule
digester.addObjectCreate("config/cluster-server/composite-rule", null,
"className");
digester.addSetProperties("config/cluster-server/composite-rule");
digester.addObjectCreate("config/cluster-server/composite-rule/rule",
null, "className");
digester.addSetProperties("config/cluster-server/composite-rule/rule");
digester.addSetNext("config/cluster-server/composite-rule/rule",
"addRule");
digester.addSetNext("config/cluster-server/composite-rule", "setRule");
// Add server to list
digester.addSetNext("config/cluster-server", "add");
return (LinkedList) digester.parse(data);
}