Search in sources :

Example 1 with CustomFunctionType

use of eu.esdihumboldt.hale.common.align.io.impl.internal.generated.CustomFunctionType in project hale by halestudio.

the class JaxbToAlignment method getPropertyFunctions.

@Override
protected Collection<CustomPropertyFunction> getPropertyFunctions(AlignmentType source, TypeIndex sourceTypes, TypeIndex targetTypes) {
    LoadAlignmentContextImpl context = new LoadAlignmentContextImpl();
    context.setSourceTypes(sourceTypes);
    context.setTargetTypes(targetTypes);
    Collection<CustomPropertyFunction> result = new ArrayList<>();
    List<CustomFunctionType> functions = source.getCustomFunction();
    if (functions != null) {
        for (CustomFunctionType function : functions) {
            Element elem = function.getAny();
            if (elem != null) {
                CustomPropertyFunction cf = HaleIO.getComplexValue(elem, CustomPropertyFunction.class, context);
                if (cf != null) {
                    result.add(cf);
                }
            }
        }
    }
    return result;
}
Also used : JAXBElement(javax.xml.bind.JAXBElement) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) CustomPropertyFunction(eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction) CustomFunctionType(eu.esdihumboldt.hale.common.align.io.impl.internal.generated.CustomFunctionType)

Aggregations

CustomPropertyFunction (eu.esdihumboldt.hale.common.align.extension.function.custom.CustomPropertyFunction)1 CustomFunctionType (eu.esdihumboldt.hale.common.align.io.impl.internal.generated.CustomFunctionType)1 ArrayList (java.util.ArrayList)1 JAXBElement (javax.xml.bind.JAXBElement)1 Element (org.w3c.dom.Element)1