private Map<String, String> translateFrom( List list ) { Map<String, String> map = new HashMap<String, String>(); for ( Iterator iter = list.iterator(); iter.hasNext(); ) { CProps prop = (CProps) iter.next(); map.put( prop.getKey(), prop.getValue() ); } return map; }
@SuppressWarnings( "unchecked" ) public static Map<String, String> getMapFromConfigList( List list ) { Map<String, String> result = new HashMap<String, String>( list.size() ); for ( Object obj : list ) { CProps props = (CProps) obj; result.put( props.getKey(), props.getValue() ); } return result; } }
/** * Method writeCProps. * * @param cProps * @param serializer * @param tagName * @throws java.io.IOException */ private void writeCProps( CProps cProps, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( cProps.getKey() != null ) { serializer.startTag( NAMESPACE, "key" ).text( cProps.getKey() ).endTag( NAMESPACE, "key" ); } if ( cProps.getValue() != null ) { serializer.startTag( NAMESPACE, "value" ).text( cProps.getValue() ).endTag( NAMESPACE, "value" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeCProps( CProps, String, XmlSerializer )
nexusTask.addParameter( prop.getKey(), prop.getValue() );