Search in sources :

Example 6 with RifVariable

use of com.onespatial.jrc.tns.oml_to_rif.translate.context.RifVariable in project hale by halestudio.

the class ModelAlignmentToModelRifTranslator method lazyCreate.

private RifVariable lazyCreate(RifVariable current, GmlAttribute fragment, ModelSentence sentence, boolean isSource) {
    // XXX what name to use here? //getName(fragment.getAttributeElement());
    String propertyName = fragment.getDefinition().getName();
    RifVariable child = sentence.findChildAttribute(current, propertyName);
    if (child == null) {
        String variableName = // $NON-NLS-1$
        fragment.getDefinition().getDeclaringType().getName().getLocalPart() + "-" + fragment.getDefinition().getName();
        variableName = variableName.toLowerCase();
        if (isSource) {
            child = sentence.createVariable(variableName);
        } else {
            child = sentence.createActionVariable(variableName, false);
        }
        child.setType(Type.ATTRIBUTE);
        child.setPropertyName(propertyName);
        child.setContextVariable(current);
    }
    return child;
}
Also used : RifVariable(com.onespatial.jrc.tns.oml_to_rif.translate.context.RifVariable)

Aggregations

RifVariable (com.onespatial.jrc.tns.oml_to_rif.translate.context.RifVariable)6 PropertyMapping (com.onespatial.jrc.tns.oml_to_rif.model.rif.PropertyMapping)2 StaticAssignment (com.onespatial.jrc.tns.oml_to_rif.model.rif.StaticAssignment)2 Formula (org.w3._2007.rif.Formula)2 Frame (org.w3._2007.rif.Frame)2 ModelRifMappingCondition (com.onespatial.jrc.tns.oml_to_rif.model.rif.ModelRifMappingCondition)1 LinkedHashMap (java.util.LinkedHashMap)1 And (org.w3._2007.rif.And)1 Assert (org.w3._2007.rif.Assert)1 Target (org.w3._2007.rif.Assert.Target)1 Actions (org.w3._2007.rif.Do.Actions)1