Search in sources :

Example 6 with TypeImpl

use of org.kie.workbench.common.services.datamodeller.core.impl.TypeImpl in project kie-wb-common by kiegroup.

the class JavaRoasterModelDriverTest method createNestedClassUpdateTest.

private DataObject createNestedClassUpdateTest() {
    DataObject dataObject = createDataObject("org.kie.workbench.common.services.datamodeller.driver.package5", "NestedClassUpdateTest", null);
    JavaClass nestedClass = new JavaClassImpl("", "NestedClass");
    nestedClass.addInterface("java.io.Serializable");
    nestedClass.addInterface("ParametrizedInterface<Integer>");
    Annotation generatedAnnotation = createAnnotation(Generated.class);
    generatedAnnotation.setValue("value", Arrays.asList("foo.bar.Generator"));
    nestedClass.addAnnotation(generatedAnnotation);
    MethodImpl method = new MethodImpl("method", Collections.EMPTY_LIST, "", new TypeImpl(void.class.getName()), Visibility.PUBLIC);
    generatedAnnotation = createAnnotation(Generated.class);
    generatedAnnotation.setValue("value", Arrays.asList("foo.bar.Generator"));
    method.addAnnotation(generatedAnnotation);
    nestedClass.addMethod(method);
    dataObject.addNestedClass(nestedClass);
    return dataObject;
}
Also used : JavaClassImpl(org.kie.workbench.common.services.datamodeller.core.impl.JavaClassImpl) DataObject(org.kie.workbench.common.services.datamodeller.core.DataObject) Generated(javax.annotation.Generated) JavaClass(org.kie.workbench.common.services.datamodeller.core.JavaClass) MethodImpl(org.kie.workbench.common.services.datamodeller.core.impl.MethodImpl) ClassAnnotation(org.kie.workbench.common.services.datamodeller.annotations.ClassAnnotation) EnumsAnnotation(org.kie.workbench.common.services.datamodeller.annotations.EnumsAnnotation) AnnotationValuesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.AnnotationValuesAnnotation) PrimitivesAnnotation(org.kie.workbench.common.services.datamodeller.annotations.PrimitivesAnnotation) TestAnnotation(org.kie.workbench.common.services.datamodeller.parser.test.TestAnnotation) MarkerAnnotation(org.kie.workbench.common.services.datamodeller.annotations.MarkerAnnotation) Annotation(org.kie.workbench.common.services.datamodeller.core.Annotation) TypeImpl(org.kie.workbench.common.services.datamodeller.core.impl.TypeImpl)

Aggregations

DataObject (org.kie.workbench.common.services.datamodeller.core.DataObject)6 MethodImpl (org.kie.workbench.common.services.datamodeller.core.impl.MethodImpl)6 TypeImpl (org.kie.workbench.common.services.datamodeller.core.impl.TypeImpl)6 AnnotationValuesAnnotation (org.kie.workbench.common.services.datamodeller.annotations.AnnotationValuesAnnotation)5 ClassAnnotation (org.kie.workbench.common.services.datamodeller.annotations.ClassAnnotation)5 EnumsAnnotation (org.kie.workbench.common.services.datamodeller.annotations.EnumsAnnotation)5 MarkerAnnotation (org.kie.workbench.common.services.datamodeller.annotations.MarkerAnnotation)5 PrimitivesAnnotation (org.kie.workbench.common.services.datamodeller.annotations.PrimitivesAnnotation)5 Annotation (org.kie.workbench.common.services.datamodeller.core.Annotation)5 TestAnnotation (org.kie.workbench.common.services.datamodeller.parser.test.TestAnnotation)5 Method (org.kie.workbench.common.services.datamodeller.core.Method)4 Parameter (org.kie.workbench.common.services.datamodeller.core.Parameter)4 Type (org.kie.workbench.common.services.datamodeller.core.Type)4 ParameterImpl (org.kie.workbench.common.services.datamodeller.core.impl.ParameterImpl)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Generated (javax.annotation.Generated)3 JavaClass (org.kie.workbench.common.services.datamodeller.core.JavaClass)3 JavaClassImpl (org.kie.workbench.common.services.datamodeller.core.impl.JavaClassImpl)3 Test (org.junit.Test)2