public List<String> getPropertyKeys(String propertyName) { Value value = getValue(propertyName); return value == null ? Collections.EMPTY_LIST : value.getPropertyKeys(); }
public List<String> getPropertyKeys(String propertyName) { Value value = getValue(propertyName); return value == null ? Collections.EMPTY_LIST : value.getPropertyKeys(); }
public List<String> getPropertyKeys(String propertyName) { Value value = getValue(propertyName); return value == null ? Collections.EMPTY_LIST : value.getPropertyKeys(); }
/** * Test whether the map contains the given partial key, prefixed with any * possible configuration prefix. */ public static boolean containsProperty(Value value, Map props) { if (value == null || props == null || props.isEmpty()) return false; List<String> partialKeys = value.getPropertyKeys(); for (String partialKey : partialKeys) { if (props.containsKey( ProductDerivations.getConfigurationKey(partialKey, props))) return true; } return false; }
/** * Test whether the map contains the given partial key, prefixed with any * possible configuration prefix. */ public static boolean containsProperty(Value value, Map props) { if (value == null || props == null || props.isEmpty()) return false; List<String> partialKeys = value.getPropertyKeys(); for (String partialKey : partialKeys) { if (props.containsKey( ProductDerivations.getConfigurationKey(partialKey, props))) return true; } return false; }
/** * Test whether the map contains the given partial key, prefixed with any * possible configuration prefix. */ public static boolean containsProperty(Value value, Map props) { if (value == null || props == null || props.isEmpty()) return false; List<String> partialKeys = value.getPropertyKeys(); for (String partialKey : partialKeys) { if (props.containsKey( ProductDerivations.getConfigurationKey(partialKey, props))) return true; } return false; }
/** * Look up the given value, testing all available prefixes and all possible * property names. Detects if the given map contains multiple keys that * are equivalent names for the given value. */ private Object findValue(Map map, Value val) { Object result = null; List<String> partialKeys = val.getPropertyKeys(); for (String partialKey : partialKeys) { String key = ProductDerivations.getConfigurationKey( partialKey, map); if (map.containsKey(key)) { // do not return immediately. Looping through all equivalent // property names will detect if the Map contains multiple keys // that are equivalent as it tries to set load key. val.setLoadKey(key); result = map.get(key); } } return result; }
/** * Look up the given value, testing all available prefixes and all possible * property names. Detects if the given map contains multiple keys that * are equivalent names for the given value. */ private Object findValue(Map map, Value val) { Object result = null; List<String> partialKeys = val.getPropertyKeys(); for (String partialKey : partialKeys) { String key = ProductDerivations.getConfigurationKey( partialKey, map); if (map.containsKey(key)) { // do not return immediately. Looping through all equivalent // property names will detect if the Map contains multiple keys // that are equivalent as it tries to set load key. val.setLoadKey(key); result = map.get(key); } } return result; }
/** * Gets all known property keys. * The keys are harvested from the property names (including the equivalent names) of the registered values. * A key may be prefixed if the corresponding property name was without a prefix. * @see #fixPrefix(String) * The Values that are {@linkplain Value#makePrivate() marked private} are filtered out. */ public Set<String> getPropertyKeys() { synchronized (_supportedKeys) { if (_supportedKeys.size() == 0) { for (Value val : _vals) { if (val.isPrivate()) continue; List<String> keys = val.getPropertyKeys(); for (String key : keys) { _supportedKeys.add(fixPrefix(key)); } } } } //OJ2257: Return a copy of _supportedKeys as calls to this method (e.g. //BrokerImpl.getSupportedProperties()) may add to this set. return new TreeSet<String>(_supportedKeys); }
/** * Look up the given value, testing all available prefixes and all possible * property names. Detects if the given map contains multiple keys that * are equivalent names for the given value. */ private Object findValue(Map map, Value val) { Object result = null; List<String> partialKeys = val.getPropertyKeys(); for (String partialKey : partialKeys) { String key = ProductDerivations.getConfigurationKey( partialKey, map); if (map.containsKey(key)) { // do not return immediately. Looping through all equivalent // property names will detect if the Map contains multiple keys // that are equivalent as it tries to set load key. val.setLoadKey(key); result = map.get(key); } } return result; }
/** * Gets all known property keys. * The keys are harvested from the property names (including the equivalent names) of the registered values. * A key may be prefixed if the corresponding property name was without a prefix. * @see #fixPrefix(String) * The Values that are {@linkplain Value#makePrivate() marked private} are filtered out. */ public Set<String> getPropertyKeys() { synchronized (_supportedKeys) { if (_supportedKeys.size() == 0) { for (Value val : _vals) { if (val.isPrivate()) continue; List<String> keys = val.getPropertyKeys(); for (String key : keys) { _supportedKeys.add(fixPrefix(key)); } } } } //OJ2257: Return a copy of _supportedKeys as calls to this method (e.g. //BrokerImpl.getSupportedProperties()) may add to this set. return new TreeSet<String>(_supportedKeys); }
/** * Gets all known property keys. * The keys are harvested from the property names (including the equivalent names) of the registered values. * A key may be prefixed if the corresponding property name was without a prefix. * @see #fixPrefix(String) * The Values that are {@linkplain Value#makePrivate() marked private} are filtered out. */ public Set<String> getPropertyKeys() { synchronized (_supportedKeys) { if (_supportedKeys.size() == 0) { for (Value val : _vals) { if (val.isPrivate()) continue; List<String> keys = val.getPropertyKeys(); for (String key : keys) { _supportedKeys.add(fixPrefix(key)); } } } } //OJ2257: Return a copy of _supportedKeys as calls to this method (e.g. //BrokerImpl.getSupportedProperties()) may add to this set. return new TreeSet<String>(_supportedKeys); }
/** * Adds <code>o</code> to <code>map</code> under key for <code>val</code>. * Use this method instead of attempting to add the value directly because * this will account for the property prefix. */ private void setValue(Map map, Value val) { Object key = val.getLoadKey(); if (key == null) { List<String> keys = val.getPropertyKeys(); for (String k : keys) { if (hasKnownPrefix(k)) { key = k; break; } } if (key == null) { key = "openjpa." + val.getProperty(); } } Object external = val.isHidden() ? Value.INVISIBLE : val instanceof ObjectValue ? val.getString() : val.get(); map.put(key, external); }
/** * Adds <code>o</code> to <code>map</code> under key for <code>val</code>. * Use this method instead of attempting to add the value directly because * this will account for the property prefix. */ private void setValue(Map map, Value val) { Object key = val.getLoadKey(); if (key == null) { List<String> keys = val.getPropertyKeys(); for (String k : keys) { if (hasKnownPrefix(k)) { key = k; break; } } if (key == null) { key = "openjpa." + val.getProperty(); } } Object external = val.isHidden() ? Value.INVISIBLE : val instanceof ObjectValue ? val.getString() : val.get(); map.put(key, external); }
/** * Adds <code>o</code> to <code>map</code> under key for <code>val</code>. * Use this method instead of attempting to add the value directly because * this will account for the property prefix. */ private void setValue(Map map, Value val) { Object key = val.getLoadKey(); if (key == null) { List<String> keys = val.getPropertyKeys(); for (String k : keys) { if (hasKnownPrefix(k)) { key = k; break; } } if (key == null) { key = "openjpa." + val.getProperty(); } } Object external = val.isHidden() ? Value.INVISIBLE : val instanceof ObjectValue ? val.getString() : val.get(); map.put(key, external); }