use of eu.esdihumboldt.hale.common.align.io.impl.internal.generated.PropertyType in project hale by halestudio.
the class DOMEntityDefinitionHelper method propertyFromDOM.
/**
* Converts the given element to a property entity definition. If any
* exception occurs <code>null</code> is returned.
*
* @param fragment the fragment to convert
* @param types the type index to use for unmarshalling
* @param ssid the schema space to use for unmarshalling
* @return the type entity definition or <code>null</code>
*/
public static PropertyEntityDefinition propertyFromDOM(Element fragment, TypeIndex types, SchemaSpaceID ssid) {
try {
JAXBContext jc = JAXBContext.newInstance(JaxbAlignmentIO.ALIGNMENT_CONTEXT, PropertyType.class.getClassLoader());
Unmarshaller u = jc.createUnmarshaller();
// it will debug problems while unmarshalling
u.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
JAXBElement<PropertyType> root = u.unmarshal(fragment, PropertyType.class);
return resolver.resolveProperty(root.getValue(), types, ssid).getDefinition();
} catch (Exception e) {
return null;
}
}
Aggregations