use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.
the class XmlTypeUtil method setSpecialBinding.
/**
* Determine if there is a special binding available for a type (apart from
* explicit definition in the schema)
*
* @param type the type definition
* @return the special binding or <code>null</code>
*/
public static boolean setSpecialBinding(XmlTypeDefinition type) {
// determine special bindings
// geometry bindings
Geometries geoms = Geometries.getInstance();
try {
Iterable<TypeConstraint> constraints = geoms.getTypeConstraints(type);
if (constraints != null) {
// GeometryType)
for (TypeConstraint constraint : constraints) {
type.setConstraint(constraint);
}
}
// enable augmented value, as the derived geometry will be stored as
// the value
// XXX should this be done in handler?!
type.setConstraint(AugmentedValueFlag.ENABLED);
type.setConstraint(SkipGeometryValidation.getInstance());
} catch (GeometryNotSupportedException e) {
// ignore - is no geometry or is not recognized
}
// otherwise the super type binding will be used
return false;
}
use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.
the class ArcByCenterPointHandler method initConstraints.
@Override
protected Collection<? extends TypeConstraint> initConstraints() {
Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
constraints.add(Binding.get(GeometryProperty.class));
constraints.add(GeometryType.get(LineString.class));
constraints.add(new GeometryFactory(this));
return constraints;
}
use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.
the class CircleHandler method initConstraints.
@Override
protected Collection<? extends TypeConstraint> initConstraints() {
Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
constraints.add(Binding.get(GeometryProperty.class));
constraints.add(GeometryType.get(LineString.class));
constraints.add(new GeometryFactory(this));
return constraints;
}
use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.
the class CurveHandler method initConstraints.
/**
* @see FixedConstraintsGeometryHandler#initConstraints()
*/
@Override
protected Collection<? extends TypeConstraint> initConstraints() {
Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
constraints.add(Binding.get(GeometryProperty.class));
// FIXME can also be a MultiLineString - is this a problem?
constraints.add(GeometryType.get(LineString.class));
constraints.add(new GeometryFactory(this));
return constraints;
}
use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.
the class EnvelopeHandler method initConstraints.
/**
* @see eu.esdihumboldt.hale.io.gml.geometry.FixedConstraintsGeometryHandler#initConstraints()
*/
@Override
protected Collection<? extends TypeConstraint> initConstraints() {
Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
constraints.add(Binding.get(GeometryProperty.class));
constraints.add(GeometryType.get(Polygon.class));
constraints.add(new GeometryFactory(this));
return constraints;
}
Aggregations