code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
@Override public void setPlaceholderSuffix(String placeholderSuffix) { this.placeholderSuffix = placeholderSuffix; }
Set the suffix that placeholders replaced by this resolver must end with. <p> The default is "}". @see org.springframework.util.SystemPropertyUtils#PLACEHOLDER_SUFFIX
setPlaceholderSuffix
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public void setValueSeparator(String valueSeparator) { this.valueSeparator = valueSeparator; }
Specify the separating character between the placeholders replaced by this resolver and their associated default value, or {@code null} if no such special character should be processed as a value separator. <p> The default is ":". @see org.springframework.util.SystemPropertyUtils#VALUE_SEPARATOR
setValueSeparator
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public void setIgnoreUnresolvableNestedPlaceholders(boolean ignoreUnresolvableNestedPlaceholders) { this.ignoreUnresolvableNestedPlaceholders = ignoreUnresolvableNestedPlaceholders; }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
setIgnoreUnresolvableNestedPlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public void setRequiredProperties(String... requiredProperties) { this.requiredProperties.addAll(Arrays.asList(requiredProperties)); }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
setRequiredProperties
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public void validateRequiredProperties() { MissingRequiredPropertiesException ex = new MissingRequiredPropertiesException(); for (String key : this.requiredProperties) { if (this.getProperty(key) == null) { ex.addMissingRequiredProperty(key); } ...
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
validateRequiredProperties
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public boolean containsProperty(String key) { return (getProperty(key) != null); }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
containsProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public String getProperty(String key) { return getProperty(key, String.class); }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public String getProperty(String key, String defaultValue) { String value = getProperty(key); return (value != null ? value : defaultValue); }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public <T> T getProperty(String key, Class<T> targetType, T defaultValue) { T value = getProperty(key, targetType); return (value != null ? value : defaultValue); }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public String getRequiredProperty(String key) throws IllegalStateException { String value = getProperty(key); if (value == null) { throw new IllegalStateException("Required key '" + key + "' not found"); } return value; }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
getRequiredProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public <T> T getRequiredProperty(String key, Class<T> valueType) throws IllegalStateException { T value = getProperty(key, valueType); if (value == null) { throw new IllegalStateException("Required key '" + key + "' not found"); } return value; }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
getRequiredProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public String resolvePlaceholders(String text) { if (this.nonStrictHelper == null) { this.nonStrictHelper = createPlaceholderHelper(true); } return doResolvePlaceholders(text, this.nonStrictHelper); }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
resolvePlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@Override public String resolveRequiredPlaceholders(String text) throws IllegalArgumentException { if (this.strictHelper == null) { this.strictHelper = createPlaceholderHelper(false); } return doResolvePlaceholders(text, this.strictHelper); }
Set whether to throw an exception when encountering an unresolvable placeholder nested within the value of a given property. A {@code false} value indicates strict resolution, i.e. that an exception will be thrown. A {@code true} value indicates that unresolvable nested placeholders should be passed through in their un...
resolveRequiredPlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
protected String resolveNestedPlaceholders(String value) { return (this.ignoreUnresolvableNestedPlaceholders ? resolvePlaceholders(value) : resolveRequiredPlaceholders(value)); }
Resolve placeholders within the given string, deferring to the value of {@link #setIgnoreUnresolvableNestedPlaceholders} to determine whether any unresolvable placeholders should raise an exception or be ignored. <p> Invoked from {@link #getProperty} and its variants, implicitly resolving nested placeholders. In contra...
resolveNestedPlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
private PropertyPlaceholderHelper createPlaceholderHelper(boolean ignoreUnresolvablePlaceholders) { return new PropertyPlaceholderHelper(this.placeholderPrefix, this.placeholderSuffix, this.valueSeparator, ignoreUnresolvablePlaceholders); }
Resolve placeholders within the given string, deferring to the value of {@link #setIgnoreUnresolvableNestedPlaceholders} to determine whether any unresolvable placeholders should raise an exception or be ignored. <p> Invoked from {@link #getProperty} and its variants, implicitly resolving nested placeholders. In contra...
createPlaceholderHelper
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
private String doResolvePlaceholders(String text, PropertyPlaceholderHelper helper) { return helper.replacePlaceholders(text, new PropertyPlaceholderHelper.PlaceholderResolver() { public String resolvePlaceholder(String placeholderName) { return getPropertyAsRawString(placeholderName...
Resolve placeholders within the given string, deferring to the value of {@link #setIgnoreUnresolvableNestedPlaceholders} to determine whether any unresolvable placeholders should raise an exception or be ignored. <p> Invoked from {@link #getProperty} and its variants, implicitly resolving nested placeholders. In contra...
doResolvePlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
public String resolvePlaceholder(String placeholderName) { return getPropertyAsRawString(placeholderName); }
Resolve placeholders within the given string, deferring to the value of {@link #setIgnoreUnresolvableNestedPlaceholders} to determine whether any unresolvable placeholders should raise an exception or be ignored. <p> Invoked from {@link #getProperty} and its variants, implicitly resolving nested placeholders. In contra...
resolvePlaceholder
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/AbstractPropertyResolver.java
Apache-2.0
@SuppressWarnings({ "rawtypes", "unchecked" }) public Map<String, Object> getSystemProperties() { try { return (Map) System.getProperties(); } catch (AccessControlException ex) { return (Map) new ReadOnlySystemAttributesMap() { @Override protec...
Add the given property source object with lowest precedence.
getSystemProperties
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override protected String getSystemAttribute(String attributeName) { try { return System.getProperty(attributeName); } catch (AccessControlException ex) { return null; } }
Add the given property source object with lowest precedence.
getSystemAttribute
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@SuppressWarnings({ "rawtypes", "unchecked" }) public Map<String, Object> getSystemEnvironment() { try { return (Map) System.getenv(); } catch (AccessControlException ex) { return (Map) new ReadOnlySystemAttributesMap() { @Override protected St...
Add the given property source object with lowest precedence.
getSystemEnvironment
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override protected String getSystemAttribute(String attributeName) { try { return System.getenv(attributeName); } catch (AccessControlException ex) { return null; } }
Add the given property source object with lowest precedence.
getSystemAttribute
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public boolean containsProperty(String key) { return this.propertyResolver.containsProperty(key); }
Add the given property source object with lowest precedence.
containsProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public String getProperty(String key) { return this.propertyResolver.getProperty(key); }
Add the given property source object with lowest precedence.
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public String getProperty(String key, String defaultValue) { return this.propertyResolver.getProperty(key, defaultValue); }
Add the given property source object with lowest precedence.
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public <T> T getProperty(String key, Class<T> targetType) { return this.propertyResolver.getProperty(key, targetType); }
Add the given property source object with lowest precedence.
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public <T> T getProperty(String key, Class<T> targetType, T defaultValue) { return this.propertyResolver.getProperty(key, targetType, defaultValue); }
Add the given property source object with lowest precedence.
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public String getRequiredProperty(String key) throws IllegalStateException { return this.propertyResolver.getRequiredProperty(key); }
Add the given property source object with lowest precedence.
getRequiredProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public <T> T getRequiredProperty(String key, Class<T> targetType) throws IllegalStateException { return this.propertyResolver.getRequiredProperty(key, targetType); }
Add the given property source object with lowest precedence.
getRequiredProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public String resolvePlaceholders(String text) { return this.propertyResolver.resolvePlaceholders(text); }
Add the given property source object with lowest precedence.
resolvePlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public String resolveRequiredPlaceholders(String text) throws IllegalArgumentException { return this.propertyResolver.resolveRequiredPlaceholders(text); }
Add the given property source object with lowest precedence.
resolveRequiredPlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ArthasEnvironment.java
Apache-2.0
@Override public boolean containsProperty(String name) { String[] propertyNames = getPropertyNames(); if (propertyNames == null) { return false; } for (String temp : propertyNames) { if (temp.equals(name)) { return true; } ...
Return whether this {@code PropertySource} contains a property with the given name. <p> This implementation checks for the presence of the given name within the {@link #getPropertyNames()} array. @param name the name of the property to find
containsProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/EnumerablePropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/EnumerablePropertySource.java
Apache-2.0
@Override public Object getProperty(String name) { return this.source.get(name); }
{@link PropertySource} that reads keys and values from a {@code Map} object. @author Chris Beams @author Juergen Hoeller @since 3.1 @see PropertiesPropertySource
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MapPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MapPropertySource.java
Apache-2.0
@Override public boolean containsProperty(String name) { return this.source.containsKey(name); }
{@link PropertySource} that reads keys and values from a {@code Map} object. @author Chris Beams @author Juergen Hoeller @since 3.1 @see PropertiesPropertySource
containsProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MapPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MapPropertySource.java
Apache-2.0
@Override public String[] getPropertyNames() { return this.source.keySet().toArray(new String[0]); }
{@link PropertySource} that reads keys and values from a {@code Map} object. @author Chris Beams @author Juergen Hoeller @since 3.1 @see PropertiesPropertySource
getPropertyNames
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MapPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MapPropertySource.java
Apache-2.0
@Override public String getMessage() { return "The following properties were declared as required but could not be resolved: " + getMissingRequiredProperties(); }
Exception thrown when required properties are not found. @author Chris Beams @since 3.1 @see ConfigurablePropertyResolver#setRequiredProperties(String...) @see ConfigurablePropertyResolver#validateRequiredProperties() @see org.springframework.context.support.AbstractApplicationContext#prepareRefresh()
getMessage
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MissingRequiredPropertiesException.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MissingRequiredPropertiesException.java
Apache-2.0
public Set<String> getMissingRequiredProperties() { return this.missingRequiredProperties; }
Return the set of properties marked as required but not present upon validation. @see ConfigurablePropertyResolver#setRequiredProperties(String...) @see ConfigurablePropertyResolver#validateRequiredProperties()
getMissingRequiredProperties
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MissingRequiredPropertiesException.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MissingRequiredPropertiesException.java
Apache-2.0
public boolean contains(String name) { return this.propertySourceList.contains(PropertySource.named(name)); }
Create a new {@code MutablePropertySources} from the given propertySources object, preserving the original order of contained {@code PropertySource} objects.
contains
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public PropertySource<?> get(String name) { int index = this.propertySourceList.indexOf(PropertySource.named(name)); return index == -1 ? null : this.propertySourceList.get(index); }
Create a new {@code MutablePropertySources} from the given propertySources object, preserving the original order of contained {@code PropertySource} objects.
get
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public Iterator<PropertySource<?>> iterator() { return this.propertySourceList.iterator(); }
Create a new {@code MutablePropertySources} from the given propertySources object, preserving the original order of contained {@code PropertySource} objects.
iterator
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public void addFirst(PropertySource<?> propertySource) { // if (logger.isDebugEnabled()) { // logger.debug(String.format("Adding [%s] PropertySource with highest search precedence", // propertySource.getName())); // } removeIfPresent(propertySource); this.propertySourceList.addFirst(propertySour...
Add the given property source object with highest precedence.
addFirst
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public void addLast(PropertySource<?> propertySource) { // if (logger.isDebugEnabled()) { // logger.debug(String.format("Adding [%s] PropertySource with lowest search precedence", // propertySource.getName())); // } removeIfPresent(propertySource); this.propertySourceList.addLast(propertySource)...
Add the given property source object with lowest precedence.
addLast
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public void addBefore(String relativePropertySourceName, PropertySource<?> propertySource) { // if (logger.isDebugEnabled()) { // logger.debug(String.format("Adding [%s] PropertySource with search precedence immediately higher than [%s]", // propertySource.getName(), relativePropertySourceName)); // } a...
Add the given property source object with precedence immediately higher than the named relative property source.
addBefore
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public void addAfter(String relativePropertySourceName, PropertySource<?> propertySource) { // if (logger.isDebugEnabled()) { // logger.debug(String.format("Adding [%s] PropertySource with search precedence immediately lower than [%s]", // propertySource.getName(), relativePropertySourceName)); // } ass...
Add the given property source object with precedence immediately lower than the named relative property source.
addAfter
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public int precedenceOf(PropertySource<?> propertySource) { return this.propertySourceList.indexOf(propertySource); }
Return the precedence of the given property source, {@code -1} if not found.
precedenceOf
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public PropertySource<?> remove(String name) { // if (logger.isDebugEnabled()) { // logger.debug(String.format("Removing [%s] PropertySource", name)); // } int index = this.propertySourceList.indexOf(PropertySource.named(name)); return index == -1 ? null : this.propertySourceList.remove(index); ...
Remove and return the property source with the given name, {@code null} if not found. @param name the name of the property source to find and remove
remove
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public void replace(String name, PropertySource<?> propertySource) { // if (logger.isDebugEnabled()) { // logger.debug(String.format("Replacing [%s] PropertySource with [%s]", // name, propertySource.getName())); // } int index = assertPresentAndGetIndex(name); this.propertySourceList.set(index,...
Replace the property source with the given name with the given property source object. @param name the name of the property source to find and replace @param propertySource the replacement property source @throws IllegalArgumentException if no property source with the given name is ...
replace
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
public int size() { return this.propertySourceList.size(); }
Return the number of {@link PropertySource} objects contained.
size
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
@Override public String toString() { String[] names = new String[this.size()]; for (int i = 0; i < size(); i++) { names[i] = this.propertySourceList.get(i).getName(); } return String.format("[%s]", arrayToCommaDelimitedString(names)); }
Return the number of {@link PropertySource} objects contained.
toString
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
protected void assertLegalRelativeAddition(String relativePropertySourceName, PropertySource<?> propertySource) { // String newPropertySourceName = propertySource.getName(); // Assert.isTrue(!relativePropertySourceName.equals(newPropertySourceName), // String.format(ILLEGAL_RELATIVE_ADDITION_MESSAGE, newPropertySo...
Ensure that the given property source is not being added relative to itself.
assertLegalRelativeAddition
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
private void addAtIndex(int index, PropertySource<?> propertySource) { removeIfPresent(propertySource); this.propertySourceList.add(index, propertySource); }
Add the given property source at a particular index in the list.
addAtIndex
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
private int assertPresentAndGetIndex(String name) { int index = this.propertySourceList.indexOf(PropertySource.named(name)); // Assert.isTrue(index >= 0, String.format(NON_EXISTENT_PROPERTY_SOURCE_MESSAGE, name)); return index; }
Assert that the named property source is present and return its index. @param name the {@linkplain PropertySource#getName() name of the property source} to find @throws IllegalArgumentException if the named property source is not present
assertPresentAndGetIndex
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
private static String nullSafeToString(Object obj) { if (obj == null) { return "null"; } if (obj instanceof String) { return (String) obj; } if (obj instanceof Object[]) { return nullSafeToString((Object[]) obj); } if (obj insta...
Return a String representation of the specified Object. <p> Builds a String representation of the contents in case of an array. Returns {@code "null"} if {@code obj} is {@code null}. @param obj the object to build a String representation for @return a String representation of {@code obj}
nullSafeToString
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/MutablePropertySources.java
Apache-2.0
@Override public String[] getPropertyNames() { synchronized (this.source) { return super.getPropertyNames(); } }
{@link PropertySource} implementation that extracts properties from a {@link java.util.Properties} object. <p> Note that because a {@code Properties} object is technically an {@code <Object, Object>} {@link java.util.Hashtable Hashtable}, one may contain non-{@code String} keys or values. This implementation, however ...
getPropertyNames
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertiesPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertiesPropertySource.java
Apache-2.0
public String replacePlaceholders(String value, final Properties properties) { return replacePlaceholders(value, new PlaceholderResolver() { public String resolvePlaceholder(String placeholderName) { return properties.getProperty(placeholderName); } }); }
Replaces all placeholders of format {@code ${name}} with the corresponding property from the supplied {@link Properties}. @param value the value containing the placeholders to be replaced @param properties the {@code Properties} to use for replacement @return the supplied value with placeholders replaced inline
replacePlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
Apache-2.0
public String resolvePlaceholder(String placeholderName) { return properties.getProperty(placeholderName); }
Replaces all placeholders of format {@code ${name}} with the corresponding property from the supplied {@link Properties}. @param value the value containing the placeholders to be replaced @param properties the {@code Properties} to use for replacement @return the supplied value with placeholders replaced inline
resolvePlaceholder
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
Apache-2.0
public String replacePlaceholders(String value, PlaceholderResolver placeholderResolver) { return parseStringValue(value, placeholderResolver, null); }
Replaces all placeholders of format {@code ${name}} with the value returned from the supplied {@link PlaceholderResolver}. @param value the value containing the placeholders to be replaced @param placeholderResolver the {@code PlaceholderResolver} to use for ...
replacePlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
Apache-2.0
protected String parseStringValue(String value, PlaceholderResolver placeholderResolver, Set<String> visitedPlaceholders) { int startIndex = value.indexOf(this.placeholderPrefix); if (startIndex == -1) { return value; } StringBuilder result = new StringBuilder(v...
Replaces all placeholders of format {@code ${name}} with the value returned from the supplied {@link PlaceholderResolver}. @param value the value containing the placeholders to be replaced @param placeholderResolver the {@code PlaceholderResolver} to use for ...
parseStringValue
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
Apache-2.0
private int findPlaceholderEndIndex(CharSequence buf, int startIndex) { int index = startIndex + this.placeholderPrefix.length(); int withinNestedPlaceholder = 0; while (index < buf.length()) { if (substringMatch(buf, index, this.placeholderSuffix)) { if (withinNested...
Replaces all placeholders of format {@code ${name}} with the value returned from the supplied {@link PlaceholderResolver}. @param value the value containing the placeholders to be replaced @param placeholderResolver the {@code PlaceholderResolver} to use for ...
findPlaceholderEndIndex
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
Apache-2.0
public static boolean substringMatch(CharSequence str, int index, CharSequence substring) { if (index + substring.length() > str.length()) { return false; } for (int i = 0; i < substring.length(); i++) { if (str.charAt(index + i) != substring.charAt(i)) { ...
Test whether the given string matches the given substring at the given index. @param str the original string (or StringBuilder) @param index the index in the original string to start matching against @param substring the substring to match at the given index
substringMatch
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertyPlaceholderHelper.java
Apache-2.0
public String getName() { return this.name; }
Return the name of this {@code PropertySource}.
getName
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
public T getSource() { return this.source; }
Return the underlying source object for this {@code PropertySource}.
getSource
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
public boolean containsProperty(String name) { return (getProperty(name) != null); }
Return whether this {@code PropertySource} contains the given name. <p> This implementation simply checks for a {@code null} return value from {@link #getProperty(String)}. Subclasses may wish to implement a more efficient algorithm if possible. @param name the property name to find
containsProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
@Override public boolean equals(Object other) { return (this == other || (other instanceof PropertySource && nullSafeEquals(this.name, ((PropertySource<?>) other).name))); }
This {@code PropertySource} object is equal to the given object if: <ul> <li>they are the same instance <li>the {@code name} properties for both objects are equal </ul> <p> No properties other than {@code name} are evaluated.
equals
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
@Override public int hashCode() { return this.name.hashCode(); }
Return a hash code derived from the {@code name} property of this {@code PropertySource} object.
hashCode
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
@Override public String toString() { return getClass().getSimpleName() + " {name='" + this.name + "'}"; }
Produce concise output (type and name) if the current log level does not include debug. If debug is enabled, produce verbose output including the hash code of the PropertySource instance and every name/value property pair. <p> This variable verbosity is useful as a property source such as system properties or environme...
toString
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
public static PropertySource<?> named(String name) { return new ComparisonPropertySource(name); }
Return a {@code PropertySource} implementation intended for collection comparison purposes only. <p> Primarily for internal use, but given a collection of {@code PropertySource} objects, may be used as follows: <pre class="code"> { &#64;code List<PropertySource<?>> sources = new ArrayList<PropertySource<?>>();...
named
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
public static boolean nullSafeEquals(Object o1, Object o2) { if (o1 == o2) { return true; } if (o1 == null || o2 == null) { return false; } if (o1.equals(o2)) { return true; } if (o1.getClass().isArray() && o2.getClass().isArray...
Determine if the given objects are equal, returning {@code true} if both are {@code null} or {@code false} if only one is {@code null}. <p> Compares arrays with {@code Arrays.equals}, performing an equality check based on the array elements rather than the array reference. @param o1 first Object to compare @param o2 s...
nullSafeEquals
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
private static boolean arrayEquals(Object o1, Object o2) { if (o1 instanceof Object[] && o2 instanceof Object[]) { return Arrays.equals((Object[]) o1, (Object[]) o2); } if (o1 instanceof boolean[] && o2 instanceof boolean[]) { return Arrays.equals((boolean[]) o1, (boolean...
Compare the given arrays with {@code Arrays.equals}, performing an equality check based on the array elements rather than the array reference. @param o1 first array to compare @param o2 second array to compare @return whether the given objects are equal @see #nullSafeEquals(Object, Object) @see java.util.Arrays#equals
arrayEquals
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySource.java
Apache-2.0
@Override public boolean containsProperty(String key) { if (this.propertySources != null) { for (PropertySource<?> propertySource : this.propertySources) { if (propertySource.containsProperty(key)) { return true; } } } ...
Create a new resolver against the given property sources. @param propertySources the set of {@link PropertySource} objects to use
containsProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
Apache-2.0
@Override public String getProperty(String key) { return getProperty(key, String.class, true); }
Create a new resolver against the given property sources. @param propertySources the set of {@link PropertySource} objects to use
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
Apache-2.0
@Override public <T> T getProperty(String key, Class<T> targetValueType) { return getProperty(key, targetValueType, true); }
Create a new resolver against the given property sources. @param propertySources the set of {@link PropertySource} objects to use
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
Apache-2.0
@Override protected String getPropertyAsRawString(String key) { return getProperty(key, String.class, false); }
Create a new resolver against the given property sources. @param propertySources the set of {@link PropertySource} objects to use
getPropertyAsRawString
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
Apache-2.0
protected <T> T getProperty(String key, Class<T> targetValueType, boolean resolveNestedPlaceholders) { if (this.propertySources != null) { for (PropertySource<?> propertySource : this.propertySources) { Object value; if ((value = propertySource.getProperty(key)) != nu...
Create a new resolver against the given property sources. @param propertySources the set of {@link PropertySource} objects to use
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
Apache-2.0
protected void logKeyFound(String key, PropertySource<?> propertySource, Object value) { // if (logger.isDebugEnabled()) { // logger.debug("Found key '" + key + "' in PropertySource '" + propertySource.getName() + // "' with value of type " + value.getClass().getSimpleName()); // } }
Log the given key as found in the given {@link PropertySource}, resulting in the given value. <p> The default implementation writes a debug log message with key and source. As of 4.3.3, this does not log the value anymore in order to avoid accidental logging of sensitive settings. Subclasses may override this method to...
logKeyFound
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/PropertySourcesPropertyResolver.java
Apache-2.0
@Override public boolean containsKey(Object key) { return (get(key) != null); }
Read-only {@code Map<String, String>} implementation that is backed by system properties or environment variables. <p> Used by {@link AbstractApplicationContext} when a {@link SecurityManager} prohibits access to {@link System#getProperties()} or {@link System#getenv()}. It is for this reason that the implementations ...
containsKey
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public String get(Object key) { if (!(key instanceof String)) { throw new IllegalArgumentException( "Type of key [" + key.getClass().getName() + "] must be java.lang.String"); } return getSystemAttribute((String) key); }
Returns the value to which the specified key is mapped, or {@code null} if this map contains no mapping for the key. @param key the name of the system attribute to retrieve @throws IllegalArgumentException if given key is non-String
get
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public boolean isEmpty() { return false; }
Returns the value to which the specified key is mapped, or {@code null} if this map contains no mapping for the key. @param key the name of the system attribute to retrieve @throws IllegalArgumentException if given key is non-String
isEmpty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public int size() { throw new UnsupportedOperationException(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
size
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public String put(String key, String value) { throw new UnsupportedOperationException(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
put
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public boolean containsValue(Object value) { throw new UnsupportedOperationException(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
containsValue
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public String remove(Object key) { throw new UnsupportedOperationException(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
remove
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public void clear() { throw new UnsupportedOperationException(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
clear
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public Set<String> keySet() { return Collections.emptySet(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
keySet
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public void putAll(Map<? extends String, ? extends String> map) { throw new UnsupportedOperationException(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
putAll
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public Collection<String> values() { return Collections.emptySet(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
values
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public Set<Entry<String, String>> entrySet() { return Collections.emptySet(); }
Template method that returns the underlying system attribute. <p> Implementations typically call {@link System#getProperty(String)} or {@link System#getenv(String)} here.
entrySet
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/ReadOnlySystemAttributesMap.java
Apache-2.0
@Override public boolean containsProperty(String name) { return (getProperty(name) != null); }
Return {@code true} if a property with the given name or any underscore/uppercase variant thereof exists in this property source.
containsProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
Apache-2.0
@Override public Object getProperty(String name) { String actualName = resolvePropertyName(name); return super.getProperty(actualName); }
This implementation returns {@code true} if a property with the given name or any underscore/uppercase variant thereof exists in this property source.
getProperty
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
Apache-2.0
protected final String resolvePropertyName(String name) { String resolvedName = checkPropertyName(name); if (resolvedName != null) { return resolvedName; } String uppercasedName = name.toUpperCase(); if (!name.equals(uppercasedName)) { resolvedName = check...
Check to see if this property source contains a property with the given name, or any underscore / uppercase variation thereof. Return the resolved name if one is found or otherwise the original name. Never returns {@code null}.
resolvePropertyName
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
Apache-2.0
private String checkPropertyName(String name) { // Check name as-is if (containsKey(name)) { return name; } // Check name with just dots replaced String noDotName = name.replace('.', '_'); if (!name.equals(noDotName) && containsKey(noDotName)) { re...
Check to see if this property source contains a property with the given name, or any underscore / uppercase variation thereof. Return the resolved name if one is found or otherwise the original name. Never returns {@code null}.
checkPropertyName
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
Apache-2.0
private boolean containsKey(String name) { return (isSecurityManagerPresent() ? this.source.keySet().contains(name) : this.source.containsKey(name)); }
Check to see if this property source contains a property with the given name, or any underscore / uppercase variation thereof. Return the resolved name if one is found or otherwise the original name. Never returns {@code null}.
containsKey
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
Apache-2.0
protected boolean isSecurityManagerPresent() { return (System.getSecurityManager() != null); }
Check to see if this property source contains a property with the given name, or any underscore / uppercase variation thereof. Return the resolved name if one is found or otherwise the original name. Never returns {@code null}.
isSecurityManagerPresent
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemEnvironmentPropertySource.java
Apache-2.0
public static String resolvePlaceholders(String text) { return resolvePlaceholders(text, false); }
Resolve {@code ${...}} placeholders in the given text, replacing them with corresponding system property values. @param text the String to resolve @return the resolved String @throws IllegalArgumentException if there is an unresolvable placeholder @see #PLACEHOLDER_PREFIX @see #PLACEHOLDER_SUFFIX
resolvePlaceholders
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemPropertyUtils.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemPropertyUtils.java
Apache-2.0
@Override public String resolvePlaceholder(String placeholderName) { try { String propVal = System.getProperty(placeholderName); if (propVal == null) { // Fall back to searching the system environment. propVal = System.getenv(pl...
PlaceholderResolver implementation that resolves against system properties and system environment variables.
resolvePlaceholder
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/SystemPropertyUtils.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/SystemPropertyUtils.java
Apache-2.0
public Class<?> getSourceType() { return this.sourceType; }
Create a new source-to-target pair. @param sourceType the source type @param targetType the target type
getSourceType
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
Apache-2.0
public Class<?> getTargetType() { return this.targetType; }
Create a new source-to-target pair. @param sourceType the source type @param targetType the target type
getTargetType
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
Apache-2.0
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || obj.getClass() != ConvertiblePair.class) { return false; } ConvertiblePair other = (ConvertiblePair) obj; return this.sourceType.equals(other.sou...
Create a new source-to-target pair. @param sourceType the source type @param targetType the target type
equals
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
Apache-2.0
@Override public int hashCode() { return this.sourceType.hashCode() * 31 + this.targetType.hashCode(); }
Create a new source-to-target pair. @param sourceType the source type @param targetType the target type
hashCode
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
Apache-2.0
@Override public String toString() { return this.sourceType.getName() + " -> " + this.targetType.getName(); }
Create a new source-to-target pair. @param sourceType the source type @param targetType the target type
toString
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/convert/ConvertiblePair.java
Apache-2.0
public static <C> Class<C[]> arrayClass(Class<C> klass) { return (Class<C[]>) Array.newInstance(klass, 0).getClass(); }
Get an array class of the given class. @param klass to get an array class of @param <C> the targeted class @return an array class of the given class
arrayClass
java
alibaba/arthas
core/src/main/java/com/taobao/arthas/core/env/convert/DefaultConversionService.java
https://github.com/alibaba/arthas/blob/master/core/src/main/java/com/taobao/arthas/core/env/convert/DefaultConversionService.java
Apache-2.0