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


Java Digester.addBeanPropertySetter方法代碼示例

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


在下文中一共展示了Digester.addBeanPropertySetter方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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;
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:23,代碼來源:DigesterUtil.java

示例2: configurePrefsDigester

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
public static Digester configurePrefsDigester(Digester digester) {        
    // prefs root
    digester.addObjectCreate("prefs", PrefsData.class );
    digester.addSetProperties("prefs" );
    digester.addBeanPropertySetter("prefs/listToolEventsOnlyAvailableInSite", "setListToolEventsOnlyAvailableInSite" );
    digester.addBeanPropertySetter("prefs/chartIn3D", "setChartIn3D" );
    digester.addBeanPropertySetter("prefs/chartTransparency", "setChartTransparency" );
    digester.addBeanPropertySetter("prefs/itemLabelsVisible", "setItemLabelsVisible" );
    digester.addBeanPropertySetter("prefs/useAllTools", "setUseAllTools" );
    
    // toolEventsDef
    digester = configureToolEventsDefDigester("prefs/", digester);
    digester.addSetNext("prefs/toolEventsDef", "setToolEventsDef" );
    
    
    return digester;
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:18,代碼來源:DigesterUtil.java

示例3: 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

示例4: getEctMeasurementsType

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
static public EctFormProp getEctMeasurementsType(InputStream is) {
    EctFormProp ret = null;
    try {
        Digester digester = new Digester();
        digester.setValidating(false);
        
        digester.addObjectCreate("formProp", EctFormProp.class);
        digester.addObjectCreate("formProp/measurement", EctMeasurementTypesBean.class);
        digester.addBeanPropertySetter("formProp/measurement/type", "type");
        digester.addBeanPropertySetter("formProp/measurement/typeDesc", "typeDesc");
        digester.addBeanPropertySetter("formProp/measurement/typeDisplayName", "typeDisplayName");
        digester.addBeanPropertySetter("formProp/measurement/measuringInstrc", "measuringInstrc");
        digester.addBeanPropertySetter("formProp/measurement/canPrefill", "canPrefill");
        
        digester.addObjectCreate("formProp/measurement/validationRule", EctValidationsBean.class);
        digester.addBeanPropertySetter("formProp/measurement/validationRule/name", "name");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/regularExp", "regularExp");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/minValue", "minValue");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/maxValue", "maxValue");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/minLength", "minLength");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/maxLength", "maxLength");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/isNumeric", "isNumeric");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/isDate", "isDate");
        digester.addSetNext("formProp/measurement/validationRule", "addValidationRule");
        
        digester.addSetNext("formProp/measurement", "addMeasurementType");
                    
        ret = (EctFormProp) digester.parse(is);
        digester.clear();
    } 
    catch (Exception exc) {
    	MiscUtils.getLogger().error("Error", exc);
    }
    return ret;
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:36,代碼來源:EctFindMeasurementTypeUtil.java

示例5: parseXML

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
public static void parseXML() {
  Digester digester = new Digester();
  digester.push(_instance); // Push controller servlet onto the stack
  digester.setValidating(false);

  digester.addObjectCreate("eformap-config/databaseap",DatabaseAP.class);
  //digester.addSetProperties("eformap-config/databaseap");
  digester.addBeanPropertySetter("eformap-config/databaseap/ap-name","apName");
  digester.addBeanPropertySetter("eformap-config/databaseap/ap-sql","apSQL");
  digester.addBeanPropertySetter("eformap-config/databaseap/ap-output","apOutput");
  digester.addBeanPropertySetter("eformap-config/databaseap/ap-insql", "apInSQL");
  digester.addBeanPropertySetter("eformap-config/databaseap/archive", "archive");
  digester.addBeanPropertySetter("eformap-config/databaseap/ap-json-output", "apJsonOutput");
  digester.addSetNext("eformap-config/databaseap","addDatabaseAP");
  try {
      Properties op = oscar.OscarProperties.getInstance();
      String configpath = op.getProperty("eform_databaseap_config");
      InputStream fs = null;
      if (configpath == null) {
         EFormLoader eLoader = new EFormLoader();
         ClassLoader loader = eLoader.getClass().getClassLoader();
         fs = loader.getResourceAsStream("/oscar/eform/apconfig.xml");
      }else{
         fs = new FileInputStream(configpath);
      }
      digester.parse(fs);
      fs.close();
  } catch (Exception e) { MiscUtils.getLogger().error("Error", e); }
}
 
開發者ID:williamgrosset,項目名稱:OSCAR-ConCert,代碼行數:30,代碼來源:EFormLoader.java

示例6: parse

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
 * Parse changelog.xml.
 *
 * @param build Current build.
 * @param browser Current browser.
 * @param changelogFile changelog.xml
 *
 * @return SCLMChangeLogSet from changelog.xml.
 *
 * @throws IOException
 * @throws SAXException
 */
@Override
public SCLMChangeLogSet parse(Run build, RepositoryBrowser<?> browser,
                                                        File changelogFile)
    throws IOException,
    SAXException
{
    Digester digester = new Digester2();

    // Parse fields.
    digester.addObjectCreate("*/changelog", LogSet.class);
    digester.addSetProperties("*/changelog");
    digester.addObjectCreate("*/changelog/entry", LogSet.Entry.class);
    digester.addSetProperties("*/changelog/entry");
    digester.addBeanPropertySetter("*/changelog/entry/date", "changeDate");
    digester.addBeanPropertySetter("*/changelog/entry/project");
    digester.addBeanPropertySetter("*/changelog/entry/alternate");
    digester.addBeanPropertySetter("*/changelog/entry/group");
    digester.addBeanPropertySetter("*/changelog/entry/type");
    digester.addBeanPropertySetter("*/changelog/entry/name");
    digester.addBeanPropertySetter("*/changelog/entry/version");
    digester.addBeanPropertySetter("*/changelog/entry/userID");
    digester.addBeanPropertySetter("*/changelog/entry/changeGroup");
    digester.addBeanPropertySetter("*/changelog/entry/editType");
    digester.addSetNext("*/changelog/entry", "addEntry");

    // Do the actual parsing
    InputStreamReader reader = new InputStreamReader(new FileInputStream(changelogFile), "UTF-8");
    LogSet temp = (LogSet)digester.parse(reader);
    reader.close();

    // Convert to SCLMChangeLogSet
    SCLMChangeLogSet res = new SCLMChangeLogSet(build,browser);
    res.fromLogSet(temp);
    return res;
}
 
開發者ID:jenkinsci,項目名稱:zos-connector-plugin,代碼行數:48,代碼來源:SCLMChangeLogParser.java

示例7: TestConfigFactory

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
 * Creates a factory instance.
 */
public TestConfigFactory() {
    digester = new Digester();
    digester.setClassLoader(Thread.currentThread().getContextClassLoader());
    digester.addObjectCreate("testportlet-config", ArrayList.class);


    digester.addObjectCreate("testportlet-config/testsuite-config",
                             TestConfig.class);

    digester.addBeanPropertySetter("testportlet-config/testsuite-config/name",
                                   "name");
    digester.addBeanPropertySetter("testportlet-config/testsuite-config/class",
                                   "testClassName");
    digester.addBeanPropertySetter("testportlet-config/testsuite-config/display-uri",
                                   "displayURI");

    digester.addCallMethod("testportlet-config/testsuite-config/init-param", "addInitParameter", 2);
    digester.addCallParam("testportlet-config/testsuite-config/init-param/name", 0);
    digester.addCallParam("testportlet-config/testsuite-config/init-param/value", 1);

    digester.addCallMethod("testportlet-config/testsuite-config/action-param", "addActionParameter", 2);
    digester.addCallParam("testportlet-config/testsuite-config/action-param/name", 0);
    digester.addCallParam("testportlet-config/testsuite-config/action-param/value", 1);

    digester.addCallMethod("testportlet-config/testsuite-config/render-param", "addRenderParameter", 2);
    digester.addCallParam("testportlet-config/testsuite-config/render-param/name", 0);
    digester.addCallParam("testportlet-config/testsuite-config/render-param/value", 1);

    digester.addSetRoot("testportlet-config/testsuite-config", "add");

}
 
開發者ID:apache,項目名稱:portals-pluto,代碼行數:35,代碼來源:TestConfigFactory.java

示例8: getEctMeasurementsType

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
static public EctFormProp getEctMeasurementsType(InputStream is) {
    EctFormProp ret = null;
    try {
        Digester digester = new Digester();
        digester.setValidating(false);
        
        digester.addObjectCreate("formProp", EctFormProp.class);
        digester.addObjectCreate("formProp/measurement", EctMeasurementTypesBean.class);
        digester.addBeanPropertySetter("formProp/measurement/type", "type");
        digester.addBeanPropertySetter("formProp/measurement/typeDesc", "typeDesc");
        digester.addBeanPropertySetter("formProp/measurement/typeDisplayName", "typeDisplayName");
        digester.addBeanPropertySetter("formProp/measurement/measuringInstrc", "measuringInstrc");
        digester.addBeanPropertySetter("formProp/measurement/canPrefill", "canPrefill");
        
        digester.addObjectCreate("formProp/measurement/validationRule", EctValidationsBean.class);
        digester.addBeanPropertySetter("formProp/measurement/validationRule/name", "name");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/regularExp", "regularExp");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/minValue", "minValue");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/maxValue", "maxValue");
 digester.addBeanPropertySetter("formProp/measurement/validationRule/minLength", "minLength");
 digester.addBeanPropertySetter("formProp/measurement/validationRule/maxLength", "maxLength");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/isNumeric", "isNumeric");
        digester.addBeanPropertySetter("formProp/measurement/validationRule/isDate", "isDate");
        digester.addSetNext("formProp/measurement/validationRule", "addValidationRule");
        
        digester.addSetNext("formProp/measurement", "addMeasurementType");
                    
        //File input = new File(xmlPath);
        ret = (EctFormProp) digester.parse(is);
        digester.clear();
    } 
    catch (Exception exc) {
    	MiscUtils.getLogger().error("Error", exc);
    }
    return ret;
}
 
開發者ID:oscarservice,項目名稱:oscar-old,代碼行數:37,代碼來源:EctFindMeasurementTypeUtil.java

示例9: 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

示例10: addCreateScale

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
private static void addCreateScale(Digester digester, Class c) {
    String name = c.getName();
    name = name.substring(name.lastIndexOf(".") + 1);
    name = name.substring(0, 1).toLowerCase() + name.substring(1);

    String pattern = "*/" + name;
    digester.addObjectCreate(pattern, c);
    digester.addSetProperties(pattern);
    digester.addBeanPropertySetter(pattern + "/unit");
    digester.addSetNext(pattern, "setScale");
}
 
開發者ID:datascience,項目名稱:photohawk,代碼行數:12,代碼來源:MeasurementsDescriptorParser.java

示例11: ICCInterface

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
private ICCInterface() {
    Digester digester = new Digester();

    digester.addObjectCreate("calculon/icc", ICCSConfig.class);
    digester.addBeanPropertySetter("calculon/icc/operator-name", "operatorName");
    digester.addBeanPropertySetter("calculon/icc/login-name", "loginName");
    digester.addBeanPropertySetter("calculon/icc/accept-min", "acceptMin");
    digester.addBeanPropertySetter("calculon/icc/accept-max", "acceptMax");
    digester.addBeanPropertySetter("calculon/icc/max-rematches", "maxRematches");
    digester.addBeanPropertySetter("calculon/icc/reseek", "reseek");
    digester.addBeanPropertySetter("calculon/icc/formula", "formula");
    digester.addObjectCreate("calculon/icc/default-seeks/seek", ICCSConfig.Seek.class);
    digester.addSetProperties("calculon/icc/default-seeks/seek", "time", "initialTime");
    digester.addSetProperties("calculon/icc/default-seeks/seek", "inc", "increment");
    digester.addSetNext("calculon/icc/default-seeks/seek", "addSeekAd");

    try {
        iccConfig = (ICCSConfig) digester.parse(ClassLoader.getSystemResourceAsStream("calculon.xml"));
    } catch (Exception e) {
        LOG.warn("Config reading failed", e);
        throw new RuntimeException(e);
    }
    LOG.trace(iccConfig.toString());

    openingBook = OpeningBook.getDefaultBook();

    listeners.add(new DebugListener());
    listeners.add(new ChallengeListener());
    listeners.add(new BoardListener());
    listeners.add(new AbortListener());
    listeners.add(new CommandListener());
    listeners.add(new ReseekListener());
    listeners.add(new ChatListener());

    listeners.add(new BlockLv2Listener());

    blockHandlers.add(new GameStartedHandler());
    blockHandlers.add(new GameEndedHandler());
    blockHandlers.add(new ClockUpdateHandler());
}
 
開發者ID:BarrySW19,項目名稱:CalculonX,代碼行數:41,代碼來源:ICCInterface.java

示例12: FICSInterface

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
private FICSInterface() {
	Digester digester = new Digester();
	
	digester.addObjectCreate("calculon/fics", FICSConfig.class);
	digester.addBeanPropertySetter("calculon/fics/operator-name", "operatorName");
	digester.addBeanPropertySetter("calculon/fics/login-name", "loginName");
	digester.addBeanPropertySetter("calculon/fics/accept-min", "acceptMin");
	digester.addBeanPropertySetter("calculon/fics/accept-max", "acceptMax");
	digester.addBeanPropertySetter("calculon/fics/max-rematches", "maxRematches");
	digester.addBeanPropertySetter("calculon/fics/reseek", "reseek");
	digester.addObjectCreate("calculon/fics/default-seeks/seek", FICSConfig.Seek.class);
	digester.addSetProperties("calculon/fics/default-seeks/seek", "time", "initialTime");
	digester.addSetProperties("calculon/fics/default-seeks/seek", "inc", "increment");
	digester.addSetNext("calculon/fics/default-seeks/seek", "addSeekAd");
	
	try {
		ficsConfig = (FICSConfig) digester.parse(ClassLoader.getSystemResourceAsStream("calculon.xml"));
	} catch (Exception e) {
		LOG.error("Config reading failed", e);
		throw new RuntimeException(e);
	}
	LOG.debug(ficsConfig.toString());
	
	openingBook = OpeningBook.getDefaultBook();

	listeners.add(new DebugListener());
	listeners.add(new ChallengeListener());
	listeners.add(new BoardListener());
	listeners.add(new AbortListener());
	listeners.add(new CommandListener());
	listeners.add(new GameEndedListener());
	listeners.add(new ReseekListener());
	listeners.add(new ChatListener());
	listeners.add(new BlockListener());

       clocks.put(Piece.WHITE, new ClockStatus());
       clocks.put(Piece.BLACK, new ClockStatus());
}
 
開發者ID:BarrySW19,項目名稱:CalculonX,代碼行數:39,代碼來源:FICSInterface.java

示例13: getJdbcResource

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
public static JdbcResource getJdbcResource(final String fileName,
		final String name) throws SyncDatabaseException, IOException {
	if (fileName == null || name == null) {
		throw new SyncDatabaseException("error.argument");
	}

	final Digester digester = new Digester();

	digester.addObjectCreate("SyncDatabase", JdbcResources.class);
	digester.addObjectCreate("SyncDatabase/jdbcResource",
			JdbcResource.class);
	digester.addSetNext("SyncDatabase/jdbcResource", "addJdbcResources");

	digester.addBeanPropertySetter("SyncDatabase/jdbcResource/name");
	digester.addBeanPropertySetter("SyncDatabase/jdbcResource/className");
	digester.addBeanPropertySetter("SyncDatabase/jdbcResource/url");
	digester.addBeanPropertySetter("SyncDatabase/jdbcResource/username");
	digester.addBeanPropertySetter("SyncDatabase/jdbcResource/password");

	final InputStream is = JdbcResource.class.getClassLoader()
			.getResourceAsStream(fileName);
	if (is == null) {
		throw new SyncDatabaseException("error.resourcefile_notfound",
				fileName);
	}

	JdbcResources resources = null;
	try {
		resources = (JdbcResources) digester.parse(is);
	} catch (final Exception e) {
		throw new SyncDatabaseException("error.resourcefile_parse", e
				.getMessage());
	} finally {
		is.close();
	}

	if (resources == null) {
		throw new SyncDatabaseException("error.resource_notfound", name);
	}

	for (final JdbcResource resource : resources.getJdbcResources()) {
		if (resource.getName().equals(name)) {
			return resource;
		}
	}

	throw new SyncDatabaseException("error.resource_notfound", name);
}
 
開發者ID:ossc-db,項目名稱:syncdb,代碼行數:49,代碼來源:JdbcResource.java

示例14: ContextMappingFactory

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private ContextMappingFactory() {
    // defaultParameters = new Properties();

    try {
        Digester digester = new Digester();
        digester.setValidating(false);

        digester.addObjectCreate("jsre-config/mapping-list",
                ArrayList.class);

        digester.addObjectCreate("jsre-config/mapping-list/mapping",
                MappingParameters.class);
        digester.addBeanPropertySetter(
                "jsre-config/mapping-list/mapping/mapping-name", "name");
        digester.addBeanPropertySetter(
                "jsre-config/mapping-list/mapping/mapping-class",
                "className");

        digester.addCallMethod(
                "jsre-config/mapping-list/mapping/init-param",
                "setParameters", 2);
        digester.addCallParam(
                "jsre-config/mapping-list/mapping/init-param/param-name", 0);
        digester.addCallParam(
                "jsre-config/mapping-list/mapping/init-param/param-value",
                1);

        digester.addSetNext("jsre-config/mapping-list/mapping", "add");

        String configFile = System.getProperty("config.file");
        if (configFile == null) {
            LOG.debug("ContextMappingFactory uses the default config file: jsre-config.xml");
            checkFileExists(JSRE_HOME + RESOURCES_PATH + "jsre-config.xml");
            mappingList = (List<MappingParameters>) digester
                    .parse(new File(JSRE_HOME + RESOURCES_PATH
                            + "jsre-config.xml"));
        } else {
            LOG.debug("ContextMappingFactory uses the config file: "
                    + configFile);
            mappingList = (List<MappingParameters>) digester
                    .parse(new File(configFile));
        }

        LOG.debug("mapping-list size: " + mappingList.size());
        for (MappingParameters mp : mappingList)
            LOG.debug("{}", mp);

    } catch (Exception e) {
        LOG.error("woops", e);
    }
}
 
開發者ID:BlueBrain,項目名稱:bluima,代碼行數:53,代碼來源:ContextMappingFactory.java

示例15: MappingFactory

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private MappingFactory() {
    // defaultParameters = new Properties();
    mappingFactory = this;

    try {
        Digester digester = new Digester();
        digester.setValidating(false);

        digester.addObjectCreate("jsre-config/mapping-list",
                ArrayList.class);

        digester.addObjectCreate("jsre-config/mapping-list/mapping",
                MappingParameters.class);
        digester.addBeanPropertySetter(
                "jsre-config/mapping-list/mapping/mapping-name", "name");
        digester.addBeanPropertySetter(
                "jsre-config/mapping-list/mapping/mapping-class",
                "className");

        digester.addCallMethod(
                "jsre-config/mapping-list/mapping/init-param",
                "setParameters", 2);
        digester.addCallParam(
                "jsre-config/mapping-list/mapping/init-param/param-name", 0);
        digester.addCallParam(
                "jsre-config/mapping-list/mapping/init-param/param-value",
                1);

        digester.addSetNext("jsre-config/mapping-list/mapping", "add");

        String configFile = System.getProperty("config.file");
        if (configFile == null) {
            LOG.debug("MappingFactory uses the default config file: jsre-config.xml");
            checkFileExists(JSRE_HOME + RESOURCES_PATH + "jsre-config.xml");
            mappingList = (List<MappingParameters>) digester
                    .parse(new File(JSRE_HOME + RESOURCES_PATH
                            + "jsre-config.xml"));
        } else {
            LOG.debug("MappingFactory uses the config file: " + configFile);
            mappingList = (List<MappingParameters>) digester
                    .parse(configFile);
        }

        LOG.debug("mapping-list size: " + mappingList.size());
        for (MappingParameters mp : mappingList)
            LOG.debug(mp.toString());

    } catch (Exception e) {
        LOG.error("woops ", e);
    }
}
 
開發者ID:BlueBrain,項目名稱:bluima,代碼行數:53,代碼來源:MappingFactory.java


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