Search in sources :

Example 1 with JavaElementKind

use of com.redhat.qute.commons.JavaElementKind in project quarkus-ls by redhat-developer.

the class ExtendedDataModelProject method updateValueResolvers.

private static void updateValueResolvers(List<TypeValueResolver> typeValueResolvers, List<FieldValueResolver> fieldValueResolvers, List<MethodValueResolver> methodValueResolvers, DataModelProject<DataModelTemplate<DataModelParameter>> project) {
    project.getValueResolvers().forEach(resolver -> {
        JavaElementKind kind = resolver.getJavaElementKind();
        switch(kind) {
            case TYPE:
                TypeValueResolver typeValueResolver = new TypeValueResolver();
                typeValueResolver.setNamed(resolver.getNamed());
                typeValueResolver.setNamespace(resolver.getNamespace());
                typeValueResolver.setSignature(resolver.getSignature());
                typeValueResolver.setSourceType(resolver.getSourceType());
                typeValueResolvers.add(typeValueResolver);
                break;
            case FIELD:
                FieldValueResolver fieldValueResolver = new FieldValueResolver();
                fieldValueResolver.setNamed(resolver.getNamed());
                fieldValueResolver.setNamespace(resolver.getNamespace());
                fieldValueResolver.setSignature(resolver.getSignature());
                fieldValueResolver.setSourceType(resolver.getSourceType());
                fieldValueResolvers.add(fieldValueResolver);
                break;
            case METHOD:
                MethodValueResolver methodValueResolver = new MethodValueResolver();
                methodValueResolver.setNamed(resolver.getNamed());
                methodValueResolver.setNamespace(resolver.getNamespace());
                methodValueResolver.setMatchName(resolver.getMatchName());
                methodValueResolver.setSignature(resolver.getSignature());
                methodValueResolver.setSourceType(resolver.getSourceType());
                methodValueResolvers.add(methodValueResolver);
                break;
            default:
                break;
        }
    });
}
Also used : TypeValueResolver(com.redhat.qute.project.datamodel.resolvers.TypeValueResolver) JavaElementKind(com.redhat.qute.commons.JavaElementKind) MethodValueResolver(com.redhat.qute.project.datamodel.resolvers.MethodValueResolver) FieldValueResolver(com.redhat.qute.project.datamodel.resolvers.FieldValueResolver)

Aggregations

JavaElementKind (com.redhat.qute.commons.JavaElementKind)1 FieldValueResolver (com.redhat.qute.project.datamodel.resolvers.FieldValueResolver)1 MethodValueResolver (com.redhat.qute.project.datamodel.resolvers.MethodValueResolver)1 TypeValueResolver (com.redhat.qute.project.datamodel.resolvers.TypeValueResolver)1