Package org.teavm.model

Examples of org.teavm.model.MethodReader


        if (cls == null || cls.getParent() == null || !cls.getParent().equals("java.lang.Enum")) {
            return;
        }
        allEnums.propagate(agent.getType(className));
        if (enumConstantsStack != null) {
            MethodReader method = cls.getMethod(new MethodDescriptor("values",
                    ValueType.arrayOf(ValueType.object(cls.getName()))));
            if (method != null) {
                agent.linkMethod(method.getReference(), enumConstantsStack).use();
            }
        }
    }
View Full Code Here


    }

    @Override
    public void afterClass(ClassReader cls) throws IOException {
        if (cls.getName().equals("java.lang.Object")) {
            MethodReader toString = cls.getMethod(new MethodDescriptor("toString", String.class));
            if (toString != null) {
                String clsName = context.getNaming().getNameFor(cls.getName());
                String toStringName = context.getNaming().getNameFor(toString.getReference());
                context.getWriter().append(clsName).append(".prototype.toString").ws().append('=').ws()
                        .append("function()").ws().append('{').indent().softNewLine();
                context.getWriter().append("return this.").append(toStringName).ws().append('?').ws()
                        .append("$rt_ustr(this.").append(toStringName).append("())").ws().append(':')
                        .append("Object.prototype.toString.call(this);").softNewLine();
View Full Code Here

TOP

Related Classes of org.teavm.model.MethodReader

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.