Search in sources :

Example 1 with GenericType

use of org.lara.language.specification.dsl.types.GenericType in project lara-framework by specs-feup.

the class LanguageSpecificationSideBar method getActions.

private List<Action> getActions(JoinPointClass joinPoint) {
    switch(sortingMethod) {
        case ALPHABETICALLY:
            return getAlphabetical(joinPoint, jp -> jp.getActions());
        case HIERARCHICALLY:
            List<Action> actions = new ArrayList<>();
            getHierarchical(joinPoint, actions, jp -> jp.getActionsSelf(), jp -> new Action(new GenericType(SEPARATOR_TYPE, false), jp.getName()));
            return actions;
        default:
            throw new NotImplementedException(sortingMethod);
    }
}
Also used : Action(org.lara.language.specification.dsl.Action) GenericType(org.lara.language.specification.dsl.types.GenericType) NotImplementedException(pt.up.fe.specs.util.exceptions.NotImplementedException) ArrayList(java.util.ArrayList)

Example 2 with GenericType

use of org.lara.language.specification.dsl.types.GenericType in project lara-framework by specs-feup.

the class LanguageSpecificationSideBar method getAttributes.

private List<Attribute> getAttributes(JoinPointClass joinPoint) {
    switch(sortingMethod) {
        case ALPHABETICALLY:
            return getAlphabetical(joinPoint, jp -> jp.getAttributes());
        case HIERARCHICALLY:
            List<Attribute> attributes = new ArrayList<>();
            getHierarchical(joinPoint, attributes, jp -> jp.getAttributesSelf(), jp -> new Attribute(new GenericType(SEPARATOR_TYPE, false), jp.getName()));
            return attributes;
        default:
            throw new NotImplementedException(sortingMethod);
    }
}
Also used : GenericType(org.lara.language.specification.dsl.types.GenericType) Attribute(org.lara.language.specification.dsl.Attribute) NotImplementedException(pt.up.fe.specs.util.exceptions.NotImplementedException) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)2 GenericType (org.lara.language.specification.dsl.types.GenericType)2 NotImplementedException (pt.up.fe.specs.util.exceptions.NotImplementedException)2 Action (org.lara.language.specification.dsl.Action)1 Attribute (org.lara.language.specification.dsl.Attribute)1