use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType.Item in project hale by halestudio.
the class OmlRdfGenerator method getPropertyCollection.
/**
* Translate the list of the OML Properties To the Jaxb-based
* PropertyCollectionType
*
* @param collection
* @return
*/
private PropertyCollectionType getPropertyCollection(List<Property> collection) {
PropertyCollectionType propCollectionType = new PropertyCollectionType();
if (collection != null) {
Iterator<?> iterator = collection.iterator();
while (iterator.hasNext()) {
// get property from a list
Property property = (Property) iterator.next();
// convert property to the property type
// TODO could be the circular dependencies in case of
// ComposedProperty
PropertyType pType = getPropertyType(property);
// add to the collection
Item item = new Item();
item.setProperty(pType);
propCollectionType.getItem().add(item);
}
}
return propCollectionType;
}
use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCollectionType.Item in project hale by halestudio.
the class OmlRdfReader method getPropertyCollection.
/**
* Returns a List of OML Properties for given jaxb-based
* PropertyCollectionType.
*
* @param collection
* @return
*/
private List<Property> getPropertyCollection(PropertyCollectionType collection) {
List<Property> properties = null;
if (collection != null) {
properties = new ArrayList<Property>();
List<Item> collectionItems = collection.getItem();
Iterator<Item> iterator = collectionItems.iterator();
Item item;
Property property;
while (iterator.hasNext()) {
item = iterator.next();
if (item.getProperty() != null) {
property = getProperty(item.getProperty());
properties.add(property);
}
}
}
return properties;
}
Aggregations