Package org.apache.velocity.util
Class DeprecationAwareExtProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.String,java.lang.Object>
-
- org.apache.velocity.util.DeprecationAwareExtProperties
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,java.lang.Object>
- Direct Known Subclasses:
ExtProperties
@Deprecated public class DeprecationAwareExtProperties extends java.util.Hashtable<java.lang.String,java.lang.Object>
Deprecated.it will disappear along with deprecated key names in 3.0.This class extends ExtProperties to handle deprecated propery key names.- Since:
- 2.1
- Version:
- $Revision: $, $Id: DeprecationAwareExtProperties.java$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
logger
Deprecated.Logger used to log the use of deprecated properties names.private static java.util.Map<java.lang.String,java.lang.String>
propertiesReplacementMap
Deprecated.Property keys replacement map, from old key name to new key nameprivate java.util.Set<java.lang.String>
warned
Deprecated.Set of old property names for which a warning has already been emitted
-
Constructor Summary
Constructors Constructor Description DeprecationAwareExtProperties()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
containsKey(java.lang.String key)
Deprecated.Property getter which checks deprecated property keysjava.lang.Object
get(java.lang.String key)
Deprecated.Property getter which checks deprecated property keysjava.lang.Object
put(java.lang.String key, java.lang.Object value)
Deprecated.Property setter which checks deprecated property keysprotected java.lang.String
translateKey(java.lang.String key)
Deprecated.Translate if needed a deprecated key into its replacement key, and emit a warning for deprecated keysprotected void
warnDeprecated(java.lang.String oldName, java.lang.String newName)
Deprecated.Emit a warning in the log for adeprecated property name-
Methods inherited from class java.util.Hashtable
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
-
-
-
-
Field Detail
-
logger
protected static org.slf4j.Logger logger
Deprecated.Logger used to log the use of deprecated properties names.
Since at the time Velocity properties are set Velocity is not yet initialized, this logger namespace can only be a child of the default logger name:
org.apache.velocity.deprecation
.It won't honor the
runtime.log.instance
orruntime.log.name
settings.
-
warned
private java.util.Set<java.lang.String> warned
Deprecated.Set of old property names for which a warning has already been emitted
-
propertiesReplacementMap
private static java.util.Map<java.lang.String,java.lang.String> propertiesReplacementMap
Deprecated.Property keys replacement map, from old key name to new key name
-
-
Method Detail
-
warnDeprecated
protected void warnDeprecated(java.lang.String oldName, java.lang.String newName)
Deprecated.Emit a warning in the log for adeprecated property name- Parameters:
oldName
- old property namenewName
- new property name
-
translateKey
protected java.lang.String translateKey(java.lang.String key)
Deprecated.Translate if needed a deprecated key into its replacement key, and emit a warning for deprecated keys- Parameters:
key
- provided key- Returns:
- translated key
-
get
public java.lang.Object get(java.lang.String key)
Deprecated.Property getter which checks deprecated property keys- Parameters:
key
- provided key- Returns:
- found value under this key or under the corresponding deprecated one, if any
-
put
public java.lang.Object put(java.lang.String key, java.lang.Object value)
Deprecated.Property setter which checks deprecated property keys- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.lang.Object>
- Overrides:
put
in classjava.util.Hashtable<java.lang.String,java.lang.Object>
- Parameters:
key
- provided keyvalue
- provided value- Returns:
- previous found value, if any
-
containsKey
public boolean containsKey(java.lang.String key)
Deprecated.Property getter which checks deprecated property keys- Parameters:
key
- provided key- Returns:
- found value under this key or under the corresponding deprecated one, if any
-
-