Search in sources :

Example 1 with MilestonedPropertyMetaData

use of org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestonedPropertyMetaData in project legend-pure by finos.

the class FunctionExpressionProcessor method milestoningMissingDateParamErrorMsg.

private static void milestoningMissingDateParamErrorMsg(ProcessorSupport processorSupport, AbstractProperty<?> property, StringBuilder message) {
    MilestonedPropertyMetaData milestonedPropertyMetaData = MilestoningFunctions.getMilestonedMetaDataForProperty((QualifiedProperty<?>) property, processorSupport);
    message.append("is milestoned with stereotypes: ");
    milestonedPropertyMetaData.getClassTemporalStereotypes().appendString(message, "[ ", ",", " ]");
    message.append(" and requires date parameters: ");
    milestonedPropertyMetaData.getTemporalDatePropertyNamesForStereotypes().appendString(message, "[ ", ", ", " ]");
}
Also used : MilestonedPropertyMetaData(org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestonedPropertyMetaData)

Example 2 with MilestonedPropertyMetaData

use of org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestonedPropertyMetaData in project legend-pure by finos.

the class MilestoningFunctionExpressionValidator method validateMissingMilestoningDateArguments.

private static void validateMissingMilestoningDateArguments(FunctionExpression functionExpression, Function<?> function, ProcessorSupport processorSupport) {
    if (MilestoningFunctions.isGeneratedMilestonedQualifiedPropertyWithMissingDates(function, processorSupport)) {
        MilestonedPropertyMetaData milestoningPropertyMetaData = MilestoningFunctions.getMilestonedMetaDataForProperty((QualifiedProperty<?>) function, processorSupport);
        ListIterable<String> temporalPropertyNames = milestoningPropertyMetaData.getTemporalDatePropertyNamesForStereotypes();
        throw new PureCompilationException(functionExpression.getSourceInformation(), "No-Arg milestoned property: '" + function._functionName() + "' must be either called in a milestoning context or supplied with " + temporalPropertyNames.makeString("[", ", ", "]") + " parameters");
    }
}
Also used : MilestonedPropertyMetaData(org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestonedPropertyMetaData) PureCompilationException(org.finos.legend.pure.m4.exception.PureCompilationException)

Example 3 with MilestonedPropertyMetaData

use of org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestonedPropertyMetaData in project legend-pure by finos.

the class FunctionExpressionProcessor method milestoningMissingDateParamErrorMsgForAllVersionInRange.

private static void milestoningMissingDateParamErrorMsgForAllVersionInRange(ProcessorSupport processorSupport, AbstractProperty<?> property, StringBuilder message) {
    MilestonedPropertyMetaData milestonedPropertyMetaData = MilestoningFunctions.getMilestonedMetaDataForProperty((QualifiedProperty<?>) property, processorSupport);
    message.append("is milestoned with stereotypes: ");
    milestonedPropertyMetaData.getClassTemporalStereotypes().appendString(message, "[ ", ",", " ]");
    message.append(" and requires 2 date parameters : [start, end]");
}
Also used : MilestonedPropertyMetaData(org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestonedPropertyMetaData)

Aggregations

MilestonedPropertyMetaData (org.finos.legend.pure.m3.compiler.postprocessing.processor.milestoning.MilestonedPropertyMetaData)3 PureCompilationException (org.finos.legend.pure.m4.exception.PureCompilationException)1