当前位置: 首页>>代码示例>>Java>>正文


Java Digester.addBeanPropertySetter方法代码示例

本文整理汇总了Java中org.apache.commons.digester3.Digester.addBeanPropertySetter方法的典型用法代码示例。如果您正苦于以下问题:Java Digester.addBeanPropertySetter方法的具体用法?Java Digester.addBeanPropertySetter怎么用?Java Digester.addBeanPropertySetter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.digester3.Digester的用法示例。


在下文中一共展示了Digester.addBeanPropertySetter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: describe4Digester

import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
public static Digester describe4Digester(Digester digester, String base) throws Exception{
		String mybase = base;
        digester.addBeanPropertySetter( mybase+"/baseclass", "baseclass" );
        digester.addBeanPropertySetter( mybase+"/kind", "kind" );
        digester.addBeanPropertySetter( mybase+"/tag", "tag" );
        digester.addBeanPropertySetter( mybase+"/name", "name" );
        digester.addBeanPropertySetter( mybase+"/description", "description" );
        digester.addBeanPropertySetter( mybase+"/help", "help" );
		String tmp = mybase + "/entries/entry";
        digester.addObjectCreate( tmp , Entry.class );
        Entry.describe4Digester(digester, tmp);
        digester.addSetNext( tmp, "addEntry" );
        // Properties
		tmp = mybase + "/properties/property";
        digester.addObjectCreate( tmp , PropertyEntry.class );
        PropertyEntry.describe4Digester(digester, tmp);
        digester.addSetNext( tmp, "addProperty" );
        
        return digester;
}
 
开发者ID:PRTG,项目名称:JMXMiniProbe,代码行数:21,代码来源:Profile.java

示例2: describe4Digester

import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
public static Digester describe4Digester(Digester digester, String base) throws Exception{
	String mybase = base;
       digester.addBeanPropertySetter( mybase+"/object", "object" );
       digester.addBeanPropertySetter( mybase+"/description", "description" );
       digester.addBeanPropertySetter( mybase+"/shortdescription", "shortDescription" );
       digester.addBeanPropertySetter( mybase+"/displayvalue", "displayValue" );
       digester.addBeanPropertySetter( mybase+"/comment", "comment" );
	String tmp = mybase + "/attributes/attribute";
	digester.addObjectCreate( tmp, StringAttribute.class );
       Attribute.describe4Digester(digester, tmp);
       digester.addSetNext( tmp, "addAttribute" );
       // Properties
	tmp = mybase + "/properties/property";
       digester.addObjectCreate( tmp , PropertyEntry.class );
       PropertyEntry.describe4Digester(digester, tmp);
       digester.addSetNext( tmp, "addProperty" );

       return digester;
}
 
开发者ID:PRTG,项目名称:JMXMiniProbe,代码行数:20,代码来源:Entry.java

示例3: read

import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
/**
 * Parses XML config of QSAdmin Plugin
 */
public static QSAdminPluginConfig read(File input) throws Exception {
	Digester digester = new Digester();
    digester.setValidating(false);

	String mainTag = "qsadmin-plugin";
	
	digester.addObjectCreate(mainTag, QSAdminPluginConfig.class);
	digester.addBeanPropertySetter(mainTag+"/name", "name");
	digester.addBeanPropertySetter(mainTag+"/desc", "desc");
	digester.addBeanPropertySetter(mainTag+"/type", "type");
	digester.addBeanPropertySetter(mainTag+"/main-class", "mainClass");
	digester.addBeanPropertySetter(mainTag+"/active", "active");
	

	logger.fine("Loading Plugin config from xml file : " + input.getAbsolutePath());
	QSAdminPluginConfig psc = (QSAdminPluginConfig) digester.parse(input);
	return psc;
}
 
开发者ID:QuickServerLab,项目名称:QuickServer-Main,代码行数:22,代码来源:PluginConfigReader.java

示例4: describe4Digester

import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
public static Digester describe4Digester(Digester digester, String base) throws Exception{
        digester.addBeanPropertySetter( base+"/object", "object" );
        digester.addBeanPropertySetter( base+"/displayvalue", "displayValue" );
        digester.addBeanPropertySetter( base+"/description", "description" );
        digester.addBeanPropertySetter( base+"/comment", "comment" );
        digester.addBeanPropertySetter( base+"/shortdescription", "shortDescription" );
        digester.addBeanPropertySetter( base+"/enabled", "enabled" );
        digester.addBeanPropertySetter( base+"/unit", "unit" );
        digester.addBeanPropertySetter( base+"/mode", "mode" );
        digester.addBeanPropertySetter( base+"/customunit", "customUnit" );
        
//        digester.addCallMethod(base+"/unit", "setUnit", 1,  new String[]{"java.lang.String"});
        digester.addBeanPropertySetter( base+"/mpy", "mpy" );
        digester.addBeanPropertySetter( base+"/div", "div" );
        
        digester.addBeanPropertySetter( base+"/limitmaxerror", "limitMaxError" );	
        digester.addBeanPropertySetter( base+"/limitmaxwarning", "limitMaxWarning" );
        digester.addBeanPropertySetter( base+"/limitminwarning", "limitMinWarning" );
        digester.addBeanPropertySetter( base+"/limitminerror", "limitMinError" );
        digester.addBeanPropertySetter( base+"/limiterrormsg", "limitErrorMsg" );
        digester.addBeanPropertySetter( base+"/limitwarningmsg", "limitWarningMsg" );
        digester.addBeanPropertySetter( base+"/limitmode", "limitMode" );
//        digester.addBeanPropertySetter( base+"/limitmode", "limitMode" );
        // Properties
		String tmp = base + "/properties/property";
        digester.addObjectCreate( tmp , PropertyEntry.class );
        PropertyEntry.describe4Digester(digester, tmp);
        digester.addSetNext( tmp, "addProperty" );
        
        return digester; 
	}
 
开发者ID:PRTG,项目名称:JMXMiniProbe,代码行数:32,代码来源:Attribute.java

示例5: getSimpleCommands

import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
public static SimpleCommandSet getSimpleCommands() {
	SimpleCommandSet sms = 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 = "simple-command-set";
		String subTag = "simple-command";
		digester.addObjectCreate(mainTag, SimpleCommandSet.class);
		digester.addObjectCreate(mainTag+"/"+subTag, SimpleCommand.class);
		digester.addBeanPropertySetter(mainTag+"/"+subTag+"/name");
		digester.addBeanPropertySetter(mainTag+"/"+subTag+"/command");
		digester.addBeanPropertySetter(mainTag+"/"+subTag+"/desc");
		digester.addBeanPropertySetter(mainTag+"/"+subTag+"/target-needed", "targetNeeded");
		digester.addBeanPropertySetter(mainTag+"/"+subTag+"/multi-line-response", "multiLineResponse");
		digester.addBeanPropertySetter(mainTag+"/"+subTag+"/version");
		digester.addSetNext(mainTag+"/"+subTag,"addCommand");
		URL configFile = 
			SimpleCommandSet.class.getResource("/org/quickserver/net/qsadmin/gui/conf/MainCommandPanel.xml");
		if(configFile==null)
			throw new RuntimeException("XML File not found : "+"MainCommandPanel.xml");

		InputStream input = configFile.openStream();
		logger.fine("Loading command config from xml file : " + input);
		sms = (SimpleCommandSet) digester.parse(input);			
	} catch(Exception e) {
		logger.severe("Could not init from xml file : " +e);
		logger.fine("StackTrace:\n"+MyString.getStackTrace(e));
	}
	return sms;
}
 
开发者ID:QuickServerLab,项目名称:QuickServer-Main,代码行数:36,代码来源:SimpleCommandSet.java

示例6: 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;
}
 
开发者ID:QuickServerLab,项目名称:QuickServer-Main,代码行数:40,代码来源:PropertieSet.java

示例7: describe4Digester

import org.apache.commons.digester3.Digester; //导入方法依赖的package包/类
public static Digester describe4Digester(Digester digester, String base) throws Exception{
		String mybase = base;
        digester.addBeanPropertySetter( mybase+"/name", "name" );
        digester.addBeanPropertySetter( mybase+"/value", "value" );
        return digester;
}
 
开发者ID:PRTG,项目名称:JMXMiniProbe,代码行数:7,代码来源:PropertyEntry.java


注:本文中的org.apache.commons.digester3.Digester.addBeanPropertySetter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。