java.util.Properties.keys()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(11.5k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中java.util.Properties.keys()方法的一些代码示例,展示了Properties.keys()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Properties.keys()方法的具体详情如下:
包路径:java.util.Properties
类名称:Properties
方法名:keys

Properties.keys介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Set the mappings of bean keys to a comma-separated list of method names.
 * The property key should match the bean key and the property value should match
 * the list of method names. When searching for method names for a bean, Spring
 * will check these mappings first.
 * @param mappings the mappings of bean keys to method names
 */
public void setMethodMappings(Properties mappings) {
  this.methodMappings = new HashMap<>();
  for (Enumeration<?> en = mappings.keys(); en.hasMoreElements();) {
    String beanKey = (String) en.nextElement();
    String[] methodNames = StringUtils.commaDelimitedListToStringArray(mappings.getProperty(beanKey));
    this.methodMappings.put(beanKey, new HashSet<>(Arrays.asList(methodNames)));
  }
}

代码示例来源:origin: pentaho/pentaho-kettle

public void clearCustomParameters() {
 Enumeration<Object> keys = properties.keys();
 while ( keys.hasMoreElements() ) {
  String key = (String) keys.nextElement();
  if ( key.startsWith( STRING_CUSTOM_PARAMETER ) ) {
   // Clear this one
   properties.remove( key );
  }
 }
}

代码示例来源:origin: OpenNMS/opennms

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));
    for (int i = 0; i < cachedSerFactories.size(); ++i) {
      java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
      javax.xml.namespace.QName qName =
          (javax.xml.namespace.QName) cachedSerQNames.get(i);
      java.lang.Object x = cachedSerFactories.get(i);
      if (x instanceof Class) {
        java.lang.Class sf = (java.lang.Class)

代码示例来源:origin: uk.org.mygrid.feta/feta-engine

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));

代码示例来源:origin: spring-projects/spring-framework

/**
 * Set the mappings of bean keys to a comma-separated list of method names.
 * <p>These method names are <b>ignored</b> when creating the management interface.
 * <p>The property key must match the bean key and the property value must match
 * the list of method names. When searching for method names to ignore for a bean,
 * Spring will check these mappings first.
 */
public void setIgnoredMethodMappings(Properties mappings) {
  this.ignoredMethodMappings = new HashMap<>();
  for (Enumeration<?> en = mappings.keys(); en.hasMoreElements();) {
    String beanKey = (String) en.nextElement();
    String[] methodNames = StringUtils.commaDelimitedListToStringArray(mappings.getProperty(beanKey));
    this.ignoredMethodMappings.put(beanKey, new HashSet<>(Arrays.asList(methodNames)));
  }
}

代码示例来源:origin: OpenNMS/opennms

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));
    for (int i = 0; i < cachedSerFactories.size(); ++i) {
      java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
      javax.xml.namespace.QName qName =
          (javax.xml.namespace.QName) cachedSerQNames.get(i);
      java.lang.Object x = cachedSerFactories.get(i);
      if (x instanceof Class) {
        java.lang.Class sf = (java.lang.Class)

代码示例来源:origin: apache/flink

for (Enumeration<Object> e = properties.keys(); e.hasMoreElements();) {
  appendXMLProperty(doc, conf, (String)e.nextElement());
  conf.appendChild(doc.createTextNode("\n"));

代码示例来源:origin: jlfex/hermes

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
Enumeration<Object> keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));

代码示例来源:origin: org.springframework/spring-context

/**
 * Set the mappings of bean keys to a comma-separated list of method names.
 * <p>These method names are <b>ignored</b> when creating the management interface.
 * <p>The property key must match the bean key and the property value must match
 * the list of method names. When searching for method names to ignore for a bean,
 * Spring will check these mappings first.
 */
public void setIgnoredMethodMappings(Properties mappings) {
  this.ignoredMethodMappings = new HashMap<>();
  for (Enumeration<?> en = mappings.keys(); en.hasMoreElements();) {
    String beanKey = (String) en.nextElement();
    String[] methodNames = StringUtils.commaDelimitedListToStringArray(mappings.getProperty(beanKey));
    this.ignoredMethodMappings.put(beanKey, new HashSet<>(Arrays.asList(methodNames)));
  }
}

代码示例来源:origin: OpenNMS/opennms

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));
    for (int i = 0; i < cachedSerFactories.size(); ++i) {
      java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
      javax.xml.namespace.QName qName =
          (javax.xml.namespace.QName) cachedSerQNames.get(i);
      java.lang.Object x = cachedSerFactories.get(i);
      if (x instanceof Class) {
        java.lang.Class sf = (java.lang.Class)

代码示例来源:origin: apache/zookeeper

public static void initialize() {
  synchronized (ProviderRegistry.class) {
    if (initialized)
      return;
    IPAuthenticationProvider ipp = new IPAuthenticationProvider();
    DigestAuthenticationProvider digp = new DigestAuthenticationProvider();
    authenticationProviders.put(ipp.getScheme(), ipp);
    authenticationProviders.put(digp.getScheme(), digp);
    Enumeration<Object> en = System.getProperties().keys();
    while (en.hasMoreElements()) {
      String k = (String) en.nextElement();
      if (k.startsWith("zookeeper.authProvider.")) {
        String className = System.getProperty(k);
        try {
          Class<?> c = ZooKeeperServer.class.getClassLoader()
              .loadClass(className);
          AuthenticationProvider ap = (AuthenticationProvider) c.getDeclaredConstructor()
              .newInstance();
          authenticationProviders.put(ap.getScheme(), ap);
        } catch (Exception e) {
          LOG.warn("Problems loading " + className,e);
        }
      }
    }
    initialized = true;
  }
}

代码示例来源:origin: org.springframework/spring-context

/**
 * Set the mappings of bean keys to a comma-separated list of method names.
 * The property key should match the bean key and the property value should match
 * the list of method names. When searching for method names for a bean, Spring
 * will check these mappings first.
 * @param mappings the mappings of bean keys to method names
 */
public void setMethodMappings(Properties mappings) {
  this.methodMappings = new HashMap<>();
  for (Enumeration<?> en = mappings.keys(); en.hasMoreElements();) {
    String beanKey = (String) en.nextElement();
    String[] methodNames = StringUtils.commaDelimitedListToStringArray(mappings.getProperty(beanKey));
    this.methodMappings.put(beanKey, new HashSet<>(Arrays.asList(methodNames)));
  }
}

代码示例来源:origin: com.google.api-ads/adwords-axis

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));
    for (int i = 0; i < cachedSerFactories.size(); ++i) {
      java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
      javax.xml.namespace.QName qName =
          (javax.xml.namespace.QName) cachedSerQNames.get(i);
      java.lang.Object x = cachedSerFactories.get(i);
      if (x instanceof Class) {
        java.lang.Class sf = (java.lang.Class)

代码示例来源:origin: org.apache.zookeeper/zookeeper

public static void initialize() {
  synchronized (ProviderRegistry.class) {
    if (initialized)
      return;
    IPAuthenticationProvider ipp = new IPAuthenticationProvider();
    DigestAuthenticationProvider digp = new DigestAuthenticationProvider();
    authenticationProviders.put(ipp.getScheme(), ipp);
    authenticationProviders.put(digp.getScheme(), digp);
    Enumeration<Object> en = System.getProperties().keys();
    while (en.hasMoreElements()) {
      String k = (String) en.nextElement();
      if (k.startsWith("zookeeper.authProvider.")) {
        String className = System.getProperty(k);
        try {
          Class<?> c = ZooKeeperServer.class.getClassLoader()
              .loadClass(className);
          AuthenticationProvider ap = (AuthenticationProvider) c
              .getDeclaredConstructor().newInstance();
          authenticationProviders.put(ap.getScheme(), ap);
        } catch (Exception e) {
          LOG.warn("Problems loading " + className,e);
        }
      }
    }
    initialized = true;
  }
}

代码示例来源:origin: SonarSource/sonarqube

public static Properties interpolateVariables(Properties properties, Map<String, String> variables) {
 Properties result = new Properties();
 Enumeration keys = properties.keys();
 while (keys.hasMoreElements()) {
  String key = (String) keys.nextElement();
  String value = (String) properties.get(key);
  String interpolatedValue = StrSubstitutor.replace(value, variables, "${env:", "}");
  result.setProperty(key, interpolatedValue);
 }
 return result;
}

代码示例来源:origin: com.google.api-ads/adwords-axis

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));
    for (int i = 0; i < cachedSerFactories.size(); ++i) {
      java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
      javax.xml.namespace.QName qName =
          (javax.xml.namespace.QName) cachedSerQNames.get(i);
      java.lang.Object x = cachedSerFactories.get(i);
      if (x instanceof Class) {
        java.lang.Class sf = (java.lang.Class)

代码示例来源:origin: cbeust/testng

@DataProvider(name = "provider")
public Object[][] createData() throws FileNotFoundException, IOException {
 Properties p = new Properties();
 List<Object> vResult = new ArrayList<>();
 p.load(new FileInputStream(new File("c:/t/data.properties")));
 for (Enumeration e = p.keys(); e.hasMoreElements(); ) {
  vResult.add(e.nextElement());
 }
 Object[][] result = new Object[vResult.size()][1];
 for (int i = 0; i < result.length; i++) {
  result[i] = new Object[] { vResult.get(i) };
 }
 return result;
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private void addEnvironment(Properties envProps) {
  JsonArray containerEnv = new JsonArray();
  Enumeration keys = envProps.keys();
  while (keys.hasMoreElements()) {
    String key = (String) keys.nextElement();
    String value = envProps.getProperty(key);
    if (value == null) {
      value = "";
    }
    containerEnv.add(key + "=" + value);
  }
  createConfig.add("Env", containerEnv);
}

代码示例来源:origin: com.google.api-ads/adwords-axis

_call.setUsername(super.cachedUsername);
  _call.setPortName(super.cachedPortName);
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
  java.lang.String key = (java.lang.String) keys.nextElement();
  _call.setProperty(key, super.cachedProperties.get(key));
    for (int i = 0; i < cachedSerFactories.size(); ++i) {
      java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
      javax.xml.namespace.QName qName =
          (javax.xml.namespace.QName) cachedSerQNames.get(i);
      java.lang.Object x = cachedSerFactories.get(i);
      if (x instanceof Class) {
        java.lang.Class sf = (java.lang.Class)

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @return all the extra options that are set to be used for the database URL
 */
@Override
public Map<String, String> getExtraOptions() {
 Map<String, String> map = new Hashtable<String, String>();
 for ( Enumeration<Object> keys = attributes.keys(); keys.hasMoreElements(); ) {
  String attribute = (String) keys.nextElement();
  if ( attribute.startsWith( ATTRIBUTE_PREFIX_EXTRA_OPTION ) ) {
   String value = attributes.getProperty( attribute, "" );
   // Add to the map...
   map.put( attribute.substring( ATTRIBUTE_PREFIX_EXTRA_OPTION.length() ), value );
  }
 }
 return map;
}

相关文章

微信公众号

最新文章

更多