Tabnine Logo
SuperProperties
Code IndexAdd Tabnine to your IDE (free)

How to use
SuperProperties
in
org.apache.openejb.util

Best Java code snippets using org.apache.openejb.util.SuperProperties (Showing top 20 results out of 315)

origin: org.apache.openejb/openejb-core

private static void printSystemProperties(final PrintStream out, final String cr) {
  try {
    final SuperProperties p = new SuperProperties();
    p.setSpaceBetweenProperties(false);
    p.setKeyValueSeparator(" = ");
    p.setLineSeparator(cr);
    copyOpenEjbProperties(System.getProperties(), p);
    copyOpenEjbProperties(SystemInstance.get().getProperties(), p);
    p.store(out, null);
    final Properties p2 = System.getProperties();
    final String[] misc = {"os.version", "os.name", "os.arch", "java.version", "java.vendor"};
    for (final String prop : misc) {
      comment(out, cr, prop + "=" + p2.get(prop));
    }
  } catch (final IOException e) {
    e.printStackTrace(new PrintWriter(new CommentsFilter(out)));
  }
}
origin: org.apache.tomee/openejb-core

private static Properties asProperties(final String definition) throws IOException {
  final SuperProperties properties = new SuperProperties();
  properties.caseInsensitive(true);
  properties.putAll(IO.readProperties(IO.read(definition), new Properties()));
  return properties;
}
origin: org.apache.tomee/openejb-core

for (final Map.Entry<Object, Object> entry : entrySet()) {
  final String key = (String) entry.getKey();
  final String value = (String) entry.getValue();
  final Map<String, String> attributes = this.attributes.get(key);
  if (comment != null || !attributes.isEmpty()) {
    dumpComment(buffer, comment, attributes, "#");
    if (spaceAfterComment) {
      buffer.append(lineSeparator);
  dumpString(buffer, key, true);
  if (value != null && value.length() > 0) {
    buffer.append(keyValueSeparator);
    dumpString(buffer, value, false);
origin: org.apache.tomee/openejb-core

/**
 * Gets the value of the properties property.
 * <p/>
 * <p/>
 * This accessor method returns a reference to the live Properties Object,
 * not a snapshot. Therefore any modification you make to the
 * returned Properties will be present inside the JAXB object.
 * This is why there is not a <CODE>set</CODE> method for the properties property.
 * <p/>
 * <p/>
 * For example, to add a new value, do as follows:
 * <pre>
 *    getProperties().setProperty(key, value);
 * </pre>
 * <p/>
 * <p/>
 * <p/>
 */
public Properties getProperties() {
  if (properties == null) {
    final SuperProperties sp = new SuperProperties();
    sp.setCaseInsensitive(true);
    properties = sp;
  }
  return properties;
}
origin: org.apache.geronimo.ext.openejb/openejb-core

  continue;
case 'u':
  nextChar = readUnicode(in);
  break;
default:
  encoded = true;
  nextChar = decodeEscapeChar(nextChar);
  break;
origin: org.apache.openejb/openejb-core

int nextByte = decodeNextCharacter(in);
if (nextByte == EOF) {
  break;
      put(key.toString(), value == null ? "" : value.toString());
        setComment(key.toString(), comment.toString());
        comment = new StringBuilder();
      this.attributes.put(normalize(key.toString()), attributes);
      attributes = new LinkedHashMap<String, String>();
        setIndent(indent);
        globalIndentSet = true;
        setIndent(indent);
        globalIndentSet = true;
          setCommentIndent(commentIndent);
          globalCommentIndentSet = true;
      checkForAttributeOrAppend(comment, attributes, commentLine, commentLineIndent);
      continue;
put(key.toString(), value == null ? "" : value.toString());
  setComment(key.toString(), comment.toString());
this.attributes.put(normalize(key.toString()), attributes);
origin: org.apache.tomee/openejb-core

final Properties overrides = new SuperProperties().caseInsensitive(true);
overrides.putAll(base);
overrides.putAll(module.getProperties());
  final SuperProperties properties = new SuperProperties().caseInsensitive(true);
  properties.putAll(globalProperties);
      properties.put(entry.getKey().toString(), entry.getValue().toString());
    properties.putAll(deployment.getProperties());
    deployment.getProperties().clear();
      final String property = key.substring(id.length());
      if (properties.containsKey(property)) {
        log.debug("Overriding ejb " + bean.getEjbName() + " property " + property + "=" + entry.getValue());
      } else {
      properties.put(property, entry.getValue());
  if (properties.size() > 0) {
    if (deployment == null) {
      final EjbDeployment ejbDeployment = openejbJar.addEjbDeployment(bean);
origin: org.apache.tomee/openejb-core

if (properties.size() > 0) {
  out.println("## Properties");
  out.println();
  for (final Object key : properties.keySet()) {
    if (key instanceof String) {
      final String name = (String) key;
      final Map<String, String> attributes = properties.getAttributes(name);
      out.println();
      final String value = properties.getProperty(name);
      String comment = properties.getComment(name);
origin: org.apache.tomee/openejb-core

private void buildDestinationDefinition(final JndiConsumer consumer, final JMSDestinationDefinition definition) {
  final JMSDestination destination = new JMSDestination();
  destination.setName(definition.name());
  destination.setClassName(definition.className());
  destination.setInterfaceName(definition.interfaceName());
  destination.setResourceAdapter(definition.resourceAdapter());
  destination.setDestinationName(definition.destinationName());
  for (final String s : definition.properties()) {
    final int equal = s.indexOf('=');
    if (equal < s.length() - 1) {
      final SuperProperties props = new SuperProperties();
      try {
        props.load(new ByteArrayInputStream(s.getBytes()));
        for (final String key : props.stringPropertyNames()) {
          if (!key.isEmpty()) {
            destination.property(key, props.getProperty(key));
          }
        }
      } catch (final IOException e) {
        final String key = s.substring(0, equal).trim();
        final String value = s.substring(equal + 1).trim();
        destination.property(key, value);
      }
    } else {
      destination.property(s.trim(), "");
    }
  }
  consumer.getJMSDestination().add(destination);
}
origin: org.apache.openejb/openejb-core

  buf.append(indent);
  buf.append("<comment>");
  buf.append(substitutePredefinedEntries(headComment));
  buf.append("</comment>");
  buf.append(lineSeparator);
  if (!isEmpty() && (spaceBetweenProperties || spaceAfterComment)) {
    buf.append(lineSeparator);
for (final Map.Entry<Object, Object> entry : entrySet()) {
  final String key = entry.getKey().toString();
  final String value = entry.getValue().toString();
    dumpComment(buf, comment, attributes, "");
  buf.append(substitutePredefinedEntries(key));
  buf.append("\">");
  buf.append(substitutePredefinedEntries(value));
  buf.append("</entry>");
  buf.append(lineSeparator);
origin: org.apache.openejb/openejb-core

/**
 * Gets the value of the properties property.
 * <p/>
 * <p/>
 * This accessor method returns a reference to the live Properties Object,
 * not a snapshot. Therefore any modification you make to the
 * returned Properties will be present inside the JAXB object.
 * This is why there is not a <CODE>set</CODE> method for the properties property.
 * <p/>
 * <p/>
 * For example, to add a new value, do as follows:
 * <pre>
 *    getProperties().setProperty(key, value);
 * </pre>
 * <p/>
 * <p/>
 * <p/>
 */
public Properties getProperties() {
  if (properties == null) {
    properties = new SuperProperties();
  }
  return properties;
}
origin: org.apache.openejb/tomee-jdbc

if (driver != null && !properties.containsKey("driverClassName")) {
  converted.setProperty("driverClassName", driver);
final String jdbcDriver = (String) properties.remove("JdbcDriver");
if (jdbcDriver != null && !properties.containsKey("driverClassName")) {
  converted.setProperty("driverClassName", jdbcDriver);
final String url = (String) properties.remove("JdbcUrl");
if (url != null && !properties.containsKey("url")) {
  converted.setProperty("url", url);
final String user = (String) properties.remove("user");
if (user != null && !properties.containsKey("username")) {
  converted.setProperty("username", user);
final String maxWait = toMillis((String) properties.remove("maxWaitTime"));
if (maxWait != null && !properties.containsKey("maxWait")) {
  converted.setProperty("maxWait", maxWait);
final String tb = toMillis((String) properties.remove("timeBetweenEvictionRuns"));
if (tb != null && !properties.containsKey("timeBetweenEvictionRunsMillis")) {
  converted.setProperty("timeBetweenEvictionRunsMillis", tb);
final String minEvict = toMillis((String) properties.remove("minEvictableIdleTime"));
if (minEvict != null && !properties.containsKey("minEvictableIdleTimeMillis")) {
  converted.setProperty("minEvictableIdleTimeMillis", minEvict);
final String passwordCipher = properties.getProperty("PasswordCipher");
if (passwordCipher != null && "PlainText".equals(passwordCipher)) { // no need to warn about it
origin: org.apache.openejb/openejb-core

final SuperProperties properties = new SuperProperties();
properties.putAll(parent.getProperties());
properties.putAll(child.getProperties());
origin: org.apache.openejb/openejb-core

final Properties props = new SuperProperties().caseInsensitive(true);
origin: org.apache.geronimo.ext.openejb/openejb-core

int nextByte = decodeNextCharacter(in);
if (nextByte == EOF) break;
char nextChar = (char) (nextByte & 0xff);
      put(key.toString(), value == null ? "" : value.toString());
        setComment(key.toString(), comment.toString());
        comment = new StringBuilder();
      this.attributes.put(normalize(key.toString()), attributes);
      attributes = new LinkedHashMap<String,String>();
        setIndent(indent);
        globalIndentSet = true;
        setIndent(indent);
        globalIndentSet = true;
          setCommentIndent(commentIndent);
          globalCommentIndentSet = true;
put(key.toString(), value == null ? "" : value.toString());
  setComment(key.toString(), comment.toString());
this.attributes.put(normalize(key.toString()), attributes);
  setIndent(indent);
origin: org.apache.openejb/openejb-core

final Properties overrides = new SuperProperties().caseInsensitive(true);
overrides.putAll(base);
overrides.putAll(module.getProperties());
  final SuperProperties properties = new SuperProperties().caseInsensitive(true);
  properties.putAll(globalProperties);
      properties.put(entry.getKey().toString(), entry.getValue().toString());
    properties.putAll(deployment.getProperties());
    deployment.getProperties().clear();
      final String property = key.substring(id.length());
      if (properties.containsKey(property)) {
        log.debug("Overriding ejb " + bean.getEjbName() + " property " + property + "=" + entry.getValue());
      } else {
      properties.put(property, entry.getValue());
  if (properties.size() > 0) {
    if (deployment == null) {
      final EjbDeployment ejbDeployment = openejbJar.addEjbDeployment(bean);
origin: org.apache.geronimo.ext.openejb/openejb-core

if (properties.size() > 0) {
  out.println("Supports the following properties");
  out.println("    || Property Name || Description ||");
  for (Object key : properties.keySet()) {
    if (key instanceof String) {
      String name = (String) key;
      Map<String, String> attributes = properties.getAttributes(name);
      if (!attributes.containsKey("hidden")) {
        String value = properties.getProperty(name);
        String comment = properties.getComment(name);
origin: org.apache.tomee/openejb-core

final int equal = s.indexOf('=');
if (equal < s.length() - 1) {
  final SuperProperties props = new SuperProperties();
  try {
    props.load(new ByteArrayInputStream(s.getBytes()));
    for (final String key : props.stringPropertyNames()) {
      if (!key.isEmpty()) {
        connectionFactory.property(key, props.getProperty(key));
origin: org.apache.geronimo.ext.openejb/openejb-core

  buf.append(indent);
  buf.append("<comment>");
  buf.append(substitutePredefinedEntries(headComment));
  buf.append("</comment>");
  buf.append(lineSeparator);
  if (!isEmpty() && (spaceBetweenProperties || spaceAfterComment)) {
    buf.append(lineSeparator);
for (Map.Entry<Object, Object> entry : entrySet()) {
  String key = (String) entry.getKey();
  String value = (String) entry.getValue();
    dumpComment(buf, comment, attributes, "");
  buf.append(substitutePredefinedEntries(key));
  buf.append("\">");
  buf.append(substitutePredefinedEntries(value));
  buf.append("</entry>");
  buf.append(lineSeparator);
origin: org.apache.tomee/openejb-core

/**
 * Gets the value of the properties property.
 * <p/>
 * <p/>
 * This accessor method returns a reference to the live Properties Object,
 * not a snapshot. Therefore any modification you make to the
 * returned Properties will be present inside the JAXB object.
 * This is why there is not a <CODE>set</CODE> method for the properties property.
 * <p/>
 * <p/>
 * For example, to add a new value, do as follows:
 * <pre>
 *    getProperties().setProperty(key, value);
 * </pre>
 * <p/>
 * <p/>
 * <p/>
 */
public Properties getProperties() {
  if (properties == null) {
    properties = new SuperProperties();
  }
  return properties;
}
org.apache.openejb.utilSuperProperties

Javadoc

Properties is a Hashtable where the keys and values must be Strings. Each Properties can have a default Properties which specifies the default values which are used if the key is not in this Properties.

Most used methods

  • <init>
    Constructs a new Properties object using the specified default properties.
  • caseInsensitive
  • entrySet
    Returns an unmodifiable view of the entries.
  • getProperty
  • putAll
  • containsKey
  • decodeEscapeChar
  • decodeNextCharacter
  • dumpComment
  • dumpString
  • get
  • getAttributes
    Searches for the attributes associated with the specified property. If the property is not found, lo
  • get,
  • getAttributes,
  • getComment,
  • getDocumentBuilder,
  • isEmpty,
  • keySet,
  • keys,
  • normalize,
  • propertyNames,
  • put

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • JLabel (javax.swing)
  • JTable (javax.swing)
  • JTextField (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now