private Map<String, List<String>> getFormatProperties( Format format ) { Map<String, List<String>> result = new LinkedHashMap<String, List<String>>(); if( formatProperties.getValueFor( format ) != null ) result.putAll( formatProperties.getValueFor( format ) ); return result; }
private Map<String, List<String>> getProtocolProperties( Protocol protocol ) { Map<String, List<String>> result = new LinkedHashMap<String, List<String>>(); if( protocolProperties.getValueFor( protocol ) != null ) result.putAll( protocolProperties.getValueFor( protocol ) ); return result; }
@Override public Map<String, List<String>> getDefaultProperties( Protocol protocol ) { return getProperties().getValueFor( protocol ); } }
@Override public Map<String, List<String>> getDefaultProperties( Format format ) { return getProperties().getValueFor( format ); } }
public Map<String, List<String>> removeRow( K key ) { if( !properties.containsRow( key ) ) return null; Map<String, List<String>> returnValue = new HashMap<String, List<String>>(); // two collections since can't iterate over keys while removing w/o getting ConcurrentModificationException. Map<String, List<String>> values = getValueFor( key ); List<String> removedItems = new ArrayList<String>( values.size() ); for( String columnName : values.keySet() ) { returnValue.put( columnName, values.get( columnName ) ); removedItems.add( columnName ); } for( String columnName : removedItems ) properties.remove( key, columnName ); return returnValue.size() != 0 ? returnValue : null; }
public Map<Format, List<Protocol>> getFormatProtocols() { Set<Protocol> defaultProtocols = getProviderDef().getProtocolProperties().keySet(); Map<Format, List<Protocol>> result = new HashMap<Format, List<Protocol>>(); MultiProperties<Format> formatProperties = getProperties(); for( Format format : formatProperties.getKeys() ) { Map<String, List<String>> properties = formatProperties.getValueFor( format ); List<Protocol> protocols = resolveProtocols( properties.get( "protocols" ) ); // if no protocols are specified, use those declared in the provider.properties if( protocols.isEmpty() ) result.put( format, new CopyOnWriteArrayList( defaultProtocols ) ); else result.put( format, protocols ); } return result; }