Package com.sun.codemodel

Examples of com.sun.codemodel.JMethod.type()


        String typeName = type.fullName();

        String getterName = ("java.lang.Boolean".equals(typeName) ? "is" : "get")
                            + fo.getPropertyInfo().getName(true);
        JMethod method = dc.getMethod(getterName, new JType[0]);
        JType mtype = method.type();
        String setterName = "set" + fo.getPropertyInfo().getName(true);
        method = dc.getMethod(setterName, new JType[] {mtype});
        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Updating setter: " + setterName);
        }
View Full Code Here


        // remove existing method and define new one
        dc.methods().remove(method);

        int mods = method.mods().getValue();
        mtype = mtype.unboxify();
        method = dc.method(mods, method.type(), setterName);
       
        method.javadoc().append(doc);
        method.param(mtype, "value");

        JFieldRef fr = JExpr.ref(fieldName);
View Full Code Here

        method.param(mtype, "value");

        JFieldRef fr = JExpr.ref(fieldName);
        method.body().assign(fr, JExpr.ref("value"));
       
        method = dc.method(mods, method.type(), "unset" + fo.getPropertyInfo().getName(true));
        method.body().assign(fr, JExpr._null());
       
        method = dc.getMethod("isSet" + fo.getPropertyInfo().getName(true), new JType[0]);
        if (method != null) {
            //move to end
View Full Code Here

        JMethod setter = null;
        final JMethod getter = this.getGetter( f );

        if ( getter != null )
        {
            final JType t = getter.type();
            final JDefinedClass clazz = f.parent().implClass;
            final String name = f.getPropertyInfo().getName( true );
            setter = clazz.getMethod( "set" + name, new JType[]
                {
                    t
View Full Code Here

                            + fo.getPropertyInfo().getName(true);

        JMethod method = dc.getMethod(getterName, new JType[0]);
        JDocComment doc = method.javadoc();
        int mods = method.mods().getValue();
        JType mtype = method.type();

        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Updating getter: " + getterName);
        }
        // remove existing method and define new one
View Full Code Here

                            + fo.getPropertyInfo().getName(true);

        JMethod method = dc.getMethod(getterName, new JType[0]);
        JDocComment doc = method.javadoc();
        int mods = method.mods().getValue();
        JType mtype = method.type();

        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Updating getter: " + getterName);
        }
        // remove existing method and define new one
View Full Code Here

            // retain existing javadoc, modifiers, and name
           
            JMethod method = dc.getMethod(getterName, new JType[0]);
            JDocComment doc = method.javadoc();
            int mods = method.mods().getValue();
            JType mtype = method.type();
            JBlock block = method.body();
           
            // remove existing method and define new one
           
            dc.methods().remove(method);
View Full Code Here

                            + fo.getPropertyInfo().getName(true);

        JMethod method = dc.getMethod(getterName, new JType[0]);
        JDocComment doc = method.javadoc();
        int mods = method.mods().getValue();
        JType mtype = method.type();

        if (LOG.isLoggable(Level.FINE)) {
            LOG.fine("Updating getter: " + getterName);
        }
        // remove existing method and define new one
View Full Code Here

      // Remove the methods:
      // * public T createT() { return new T(); }
      // * public JAXBElement<T> createT(T value) { return new JAXBElement<T>(QNAME, T.class, null, value); }
      // * @XmlElementDecl(..., scope = X.class)
      //   public JAXBElement<T> createT...(T value) { return new JAXBElement<...>(QNAME, T.class, X.class, value); }
      if ((method.type() instanceof JDefinedClass && ((JDefinedClass) method.type()).isAssignableFrom(candidate
                  .getCandidateClass()))
                  || isListedAsParametrisation(candidate.getCandidateClass(), method.type())
                  || candidate.getScopedElementInfos().containsKey(method.name())) {
        writeSummary("\tRemoving factory method [" + method.type().fullName() + "#" + method.name()
                    + "()] from " + factoryClass.fullName());
View Full Code Here

      // Remove the methods:
      // * public T createT() { return new T(); }
      // * public JAXBElement<T> createT(T value) { return new JAXBElement<T>(QNAME, T.class, null, value); }
      // * @XmlElementDecl(..., scope = X.class)
      //   public JAXBElement<T> createT...(T value) { return new JAXBElement<...>(QNAME, T.class, X.class, value); }
      if ((method.type() instanceof JDefinedClass && ((JDefinedClass) method.type()).isAssignableFrom(candidate
                  .getCandidateClass()))
                  || isListedAsParametrisation(candidate.getCandidateClass(), method.type())
                  || candidate.getScopedElementInfos().containsKey(method.name())) {
        writeSummary("\tRemoving factory method [" + method.type().fullName() + "#" + method.name()
                    + "()] from " + factoryClass.fullName());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.