use of eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AppSchemaDataAccessType in project hale by halestudio.
the class AppSchemaMappingTest method initMapping.
@Before
public void initMapping() {
mappingWrapper = new AppSchemaMappingWrapper(new AppSchemaDataAccessType());
mappingContext = new AppSchemaMappingContext(mappingWrapper);
// initialize namespaces
mappingContext.getOrCreateNamespace(LANDCOVER_NS, LANDCOVER_PREFIX);
mappingContext.getOrCreateNamespace(BASE_NS, BASE_PREFIX);
mappingContext.getOrCreateNamespace(GML_NS, GML_PREFIX);
mappingContext.getOrCreateNamespace(GMD_NS, GMD_PREFIX);
mappingContext.getOrCreateNamespace(XLINK_NS, XLINK_PREFIX);
}
use of eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AppSchemaDataAccessType in project hale by halestudio.
the class AppSchemaMappingGenerator method writeMapping.
static void writeMapping(OutputStream out, AppSchemaDataAccessType mapping) throws JAXBException {
JAXBContext context = createJaxbContext();
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
JAXBElement<AppSchemaDataAccessType> mappingConfElement = new ObjectFactory().createAppSchemaDataAccess(mapping);
marshaller.marshal(mappingConfElement, out);
}
use of eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AppSchemaDataAccessType in project hale by halestudio.
the class AppSchemaMappingWrapper method getIncludedTypesMapping.
/**
* Returns the mapping configuration for the included types mapping file.
*
* <p>
* If the mapping does not require multiple files, <code>null</code> is
* returned.
* </p>
*
* @return a copy of the included types mapping configuration, or
* <code>null</code>
*/
public AppSchemaDataAccessType getIncludedTypesMapping() {
if (requiresMultipleFiles()) {
AppSchemaDataAccessType includedTypesMapping = cloneMapping(appSchemaMapping);
Set<FeatureTypeMapping> toBeRemoved = new HashSet<FeatureTypeMapping>();
Set<FeatureTypeMapping> toBeKept = new HashSet<FeatureTypeMapping>();
groupTypeMappings(toBeRemoved, toBeKept);
purgeTypeMappings(includedTypesMapping, toBeRemoved);
return includedTypesMapping;
} else {
return null;
}
}
Aggregations