/** * Converts the given configuration into a list of {@link MIProperty}s using the given factory. * * @param configuration * The configuration to be converted. * @param factory * The factory to be used to create the model instances. * @return A list of model instances. */ public static List<MIProperty> convertProperties(final Configuration configuration, final MAnalysisMetaModelFactory factory) { if (null == configuration) { // should not happen, but better be safe than sorry return Collections.emptyList(); } final List<MIProperty> properties = new ArrayList<MIProperty>(configuration.size()); for (final Enumeration<?> e = configuration.propertyNames(); e.hasMoreElements();) { final String key = (String) e.nextElement(); final MIProperty property = factory.createProperty(); property.setName(key); property.setValue(configuration.getStringProperty(key)); properties.add(property); } return properties; }
/** * Converts the given configuration into a list of {@link MIProperty}s using the given factory. * * @param configuration * The configuration to be converted. * @param factory * The factory to be used to create the model instances. * @return A list of model instances. */ public static List<MIProperty> convertProperties(final Configuration configuration, final MAnalysisMetaModelFactory factory) { if (null == configuration) { // should not happen, but better be safe than sorry return Collections.emptyList(); } final List<MIProperty> properties = new ArrayList<MIProperty>(configuration.size()); for (final Enumeration<?> e = configuration.propertyNames(); e.hasMoreElements();) { final String key = (String) e.nextElement(); final MIProperty property = factory.createProperty(); property.setName(key); property.setValue(configuration.getStringProperty(key)); properties.add(property); } return properties; }
final MIProperty mProperty = factory.createProperty(); mProperty.setName((String) property.getKey()); mProperty.setValue((String) property.getValue());
final MIProperty mProperty = factory.createProperty(); mProperty.setName((String) property.getKey()); mProperty.setValue((String) property.getValue());