Package org.teavm.model

Examples of org.teavm.model.AnnotationReader


    @Override
    public void begin(RenderingContext context, BuildTarget buildTarget) throws IOException {
        boolean hasOneResource = false;
        for (String className : context.getClassSource().getClassNames()) {
            ClassReader cls = context.getClassSource().get(className);
            AnnotationReader annot = cls.getAnnotations().get(JavaScriptResource.class.getName());
            if (annot == null) {
                continue;
            }
            String path = annot.getValue("value").getString();
            String packageName = className.substring(0, className.lastIndexOf('.'));
            String resourceName = packageName.replace('.', '/') + "/" + path;
            try (InputStream input = context.getClassLoader().getResourceAsStream(resourceName)) {
                if (input == null) {
                    throw new RenderingException("Error processing JavaScriptResource annotation on class " +
View Full Code Here


        return method.getAnnotations().get(Test.class.getName()) != null;
    }

    @Override
    public Iterable<String> getExpectedExceptions(MethodReader method) {
        AnnotationReader annot = method.getAnnotations().get(Test.class.getName());
        AnnotationValue expectedAnnot = annot.getValue("expected");
        if (expectedAnnot != null) {
            String className = ((ValueType.Object)expectedAnnot.getJavaClass()).getClassName();
            return Collections.singletonList(className);
        }
        return Collections.emptyList();
View Full Code Here

TOP

Related Classes of org.teavm.model.AnnotationReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.