Examples of JavaParameter


Examples of com.thoughtworks.qdox.model.JavaParameter

                });

        if (count == 0) {
            // Let's generate it then
            PrimaryKeyClassPlugin pkPlugin = EjbRuntime.getPrimaryKeyClassPlugin();
            JavaParameter javaParameter = new JavaParameter(new Type(pkPlugin.pkClass(javaClass)), "pk");
            JavaMethod finderMethod = new JavaMethod();
            finderMethod.setName("findByPrimaryKey");
            finderMethod.setParameters(new JavaParameter[] {javaParameter});

            // Let's add it finally
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

            if (pkType != null && propName != null) {
                prop = new BeanProperty(propName);
                prop.setType(pkType);
                JavaMethod getter = new JavaMethod(pkType, getGetterName(prop));
                JavaMethod setter = new JavaMethod(pkType, getSetterName(prop));
                setter.setParameters(new JavaParameter[] {new JavaParameter(pkType, prop.getName())});
                prop.setAccessor(getter);
                prop.setMutator(setter);
            }

            return prop;
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

            method.setModifiers(new String[] { "public" });

            JavaParameter[] params = new JavaParameter[((properties != null) ? properties.length : 0) ((parentProperties != null) ? parentProperties.length : 0)];
            int idx = 0;
            for (int i = 0; (properties != null) && (i < properties.length); i++) {
                params[idx++] = new JavaParameter(properties[i].getType(), properties[i].getName());
            }
            for (int i = 0; (parentProperties != null) && (i < parentProperties.length); i++) {
                params[idx++] = new JavaParameter(parentProperties[i].getType(), parentProperties[i].getName());
            }
            method.setParameters(params);
            retVal.addMethod(method);
        }

        for (int i = 0; (properties != null) && (i < properties.length); i++) {
            method = new JavaMethod(getSetterName(properties[i]));
            method.setModifiers(new String[] { "public" });
            method.setParameters(new JavaParameter[]{new JavaParameter(properties[i].getType(), properties[i].getName())});
            retVal.addMethod(method);
            method = new JavaMethod(properties[i].getType(), getGetterName(properties[i]));
            method.setModifiers(new String[] { "public" });
            retVal.addMethod(method);
        }

        method = new JavaMethod(new Type("int"), "hashCode");
        method.setModifiers(new String[] { "public" });
        retVal.addMethod(method);

        method = new JavaMethod(new Type("boolean"), "equals");
        method.setModifiers(new String[] { "public" });
        method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.lang.Object"), "other")});
        retVal.addMethod(method);

        method = new JavaMethod(new Type("java.lang.String"), "toString");
        method.setModifiers(new String[] { "public" });
        retVal.addMethod(method);
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

                    while (dMatcher.find(dMatcher.end())) {
                        paramDim++;
                    }
                }

                paramLst.add(new JavaParameter(new Type(paramType, paramDim), paramName));
                beginIdx = matcher.end();
            }

            method.setParameters((JavaParameter[]) paramLst.toArray(new JavaParameter[0]));
            return method;
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

            if (metaVo.isGeneratePKConstructor() && metaVo.hasPk()) {
                if(!isEmpty(nonPkFields) || !metaVo.isSimplePkProperty()) {
                    method = new JavaMethod(getDestinationClassname(metadata));
                    method.setConstructor(true);
                    method.setModifiers(new String[] { "public" });
                    method.setParameters(new JavaParameter[]{new JavaParameter(pkProperty.getType(), pkProperty.getName())});
                    retVal.addMethod(method);
                }
                if(!isEmpty(nonPkFields) && !metaVo.isSimplePkProperty()) {
                    method = new JavaMethod(getDestinationClassname(metadata));
                    method.setConstructor(true);
                    method.setModifiers(new String[] { "public" });
                    JavaParameter[] params = new JavaParameter[nonPkFields.length + 1];
                    params[0] = new JavaParameter(pkProperty.getType(), pkProperty.getName());
                    for (int j = 0; j < nonPkFields.length; j++) {
                        ValueObjectFieldMetadata nonPkField = nonPkFields[j];
                        params[j+1] = new JavaParameter(nonPkField.getProperty().getType(), nonPkField.getProperty().getName());
                    }
                    method.setParameters(params);
                    retVal.addMethod(method);
                }
            }

            ValueObjectFieldMetadata[] fields = metaVo.getFields();
            if (!isEmpty(fields)) {
                method = new JavaMethod(getDestinationClassname(metadata));
                method.setConstructor(true);
                method.setModifiers(new String[] { "public" });
                JavaParameter[] params = new JavaParameter[fields.length];
                for (int j = 0; j < fields.length; j++) {
                    ValueObjectFieldMetadata vField = fields[j];
                    params[j] = new JavaParameter(vField.getProperty().getType(), vField.getProperty().getName());
                }
                method.setParameters(params);
                retVal.addMethod(method);
            }

            if (metaVo.hasPk() && !metaVo.isSimplePkProperty()) {
                method = new JavaMethod(pkProperty.getType(), pkProperty.getAccessor().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);

                method = new JavaMethod(pkProperty.getMutator().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(pkProperty.getType(), pkProperty.getName())});
                retVal.addMethod(method);
            }

            if (getEjbUtils().isUseSoftLocking(metadata)) {
                method = new JavaMethod(new Type("int"), "getVersion");
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);

                method = new JavaMethod("setVersion");
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type("int"), "version")});
                retVal.addMethod(method);
            }

            for (int j = 0; (fields != null) && (j < fields.length); j++) {
                ValueObjectFieldMetadata vField = fields[j];
                method = new JavaMethod(vField.getProperty().getType(), vField.getProperty().getAccessor().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);

                method = new JavaMethod(vField.getProperty().getMutator().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(vField.getProperty().getType(), vField.getProperty().getName())});
                retVal.addMethod(method);

                method = new JavaMethod(new Type("boolean"), vField.getProperty().getName()+"HasBeenSet");
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);
            }

            for (int k = 0; k < nonCollectionRel.length; k++) {
                ValueObjectRelationMetadata nonColRel = nonCollectionRel[k];

                method = new JavaMethod(nonColRel.getProperty().getType(), nonColRel.getProperty().getAccessor().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);

                method = new JavaMethod(nonColRel.getProperty().getMutator().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(nonColRel.getProperty().getType(), nonColRel.getProperty().getName())});
                retVal.addMethod(method);

                method = new JavaMethod(new Type("boolean"), nonColRel.getProperty().getName()+"HasBeenSet");
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);
            }

            for (int k = 0; k < collectionRel.length; k++) {
                ValueObjectRelationMetadata colRel = collectionRel[k];

                field = new JavaField(colRel.getProperty().getType(), "added" + colRel.getProperty().getName());
                field.setModifiers(new String[]{"protected"});
                retVal.addField(field);
                field = new JavaField(colRel.getProperty().getType(), "onceAdded" + colRel.getProperty().getName());
                field.setModifiers(new String[]{"protected"});
                retVal.addField(field);
                field = new JavaField(colRel.getProperty().getType(), "removed" + colRel.getProperty().getName());
                field.setModifiers(new String[]{"protected"});
                retVal.addField(field);
                field = new JavaField(colRel.getProperty().getType(), "updated" + colRel.getProperty().getName());
                field.setModifiers(new String[]{"protected"});
                retVal.addField(field);

                method = new JavaMethod(colRel.getProperty().getType(), "getAdded" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                retVal.addMethod(method);
                method = new JavaMethod(colRel.getProperty().getType(), "getOnceAdded" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                retVal.addMethod(method);
                method = new JavaMethod(colRel.getProperty().getType(), "getRemoved" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                retVal.addMethod(method);
                method = new JavaMethod(colRel.getProperty().getType(), "getUpdated" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                retVal.addMethod(method);

                method = new JavaMethod(colRel.getProperty().getType(), colRel.getProperty().getAccessor().getName()+"Collection");
                method.setModifiers(new String[]{"public"});
                retVal.addMethod(method);

                method = new JavaMethod(new Type(colRel.getAggregate(),1), colRel.getProperty().getAccessor().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);

                method = new JavaMethod(colRel.getProperty().getMutator().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type(colRel.getAggregate(),1), colRel.getProperty().getName())});
                retVal.addMethod(method);

                method = new JavaMethod("clear"+colRel.getProperty().getName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);

                method = new JavaMethod("add"+colRel.getAggregateName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type(colRel.getAggregate()), "other")});
                retVal.addMethod(method);

                method = new JavaMethod("remove"+colRel.getAggregateName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type(colRel.getAggregate()), "other")});
                retVal.addMethod(method);

                method = new JavaMethod("update"+colRel.getAggregateName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type(colRel.getAggregate()), "other")});
                retVal.addMethod(method);

                method = new JavaMethod("clean"+colRel.getAggregateName());
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                retVal.addMethod(method);

                method = new JavaMethod("copy"+colRel.getProperty().getName()+"From");
                modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
                modifiers[0] = "public";
                if (metaVo.isFullSynchronization()) {
                    modifiers[1] = "synchronized";
                }
                method.setModifiers(modifiers);
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type(getDestinationFullyQualifiedClassName(metadata)), "other")});
                retVal.addMethod(method);
            }

            method = new JavaMethod(new Type("java.lang.String"), "toString");
            modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
            modifiers[0] = "public";
            if (metaVo.isFullSynchronization()) {
                modifiers[1] = "synchronized";
            }
            method.setModifiers(modifiers);
            retVal.addMethod(method);

            method = new JavaMethod(new Type("boolean"), "hasIdentity");
            modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
            modifiers[0] = "protected";
            if (metaVo.isFullSynchronization()) {
                modifiers[1] = "synchronized";
            }
            method.setModifiers(modifiers);
            retVal.addMethod(method);

            method = new JavaMethod(new Type("boolean"), "equals");
            method.setModifiers(new String[]{"public"});
            method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.lang.Object"), "other")});
            retVal.addMethod(method);

            if (metaVo.isStrictOrdering()) {
                method = new JavaMethod(new Type("int"), "compareTo");
                method.setModifiers(new String[]{"public"});
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.lang.Object"), "other")});
                retVal.addMethod(method);
            }

            method = new JavaMethod(new Type("java.lang.Object"), "clone");
            modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
            modifiers[0] = "public";
            if (metaVo.isFullSynchronization()) {
                modifiers[1] = "synchronized";
            }
            method.setModifiers(modifiers);
            retVal.addMethod(method);

            method = new JavaMethod(new Type("int"), "hashCode");
            modifiers = new String[metaVo.isFullSynchronization() ? 2 : 1];
            modifiers[0] = "public";
            if (metaVo.isFullSynchronization()) {
                modifiers[1] = "synchronized";
            }
            method.setModifiers(modifiers);
            retVal.addMethod(method);

            JavaClass innerClass = createDynamicJavaClass("ReadOnly" + getDestinationClassname(metadata), getDestinationPackage(metadata), null, getMetadataProvider());
            innerClass.setModifiers(new String[]{"final","private"});
            retVal.addClass(innerClass);

            method = new JavaMethod(innerClass.asType(), "getReadOnly"+getDestinationClassname(metadata));
            method.setModifiers(new String[]{"public"});
            retVal.addMethod(method);

            method = new JavaMethod(new Type("java.util.Collection"), "wrapCollection");
            method.setModifiers(new String[]{"private", "static"});
            method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.util.Collection"), "input")});
            retVal.addMethod(method);

            method = new JavaMethod(new Type("java.util.Set"), "wrapCollection");
            method.setModifiers(new String[]{"private", "static"});
            method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.util.Set"), "input")});
            retVal.addMethod(method);

            method = new JavaMethod(new Type("java.util.Collection"), "wrapReadOnly");
            method.setModifiers(new String[]{"private", "static"});
            method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.util.Collection"), "input")});
            retVal.addMethod(method);

            method = new JavaMethod(new Type("java.util.Set"), "wrapReadOnly");
            method.setModifiers(new String[]{"private", "static"});
            method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.util.Set"), "input")});
            retVal.addMethod(method);

            // handle inner class

            implementz = getImplements(metadata);
            implementzTypes = new Type[implementz.length];
            for (int j = 0; j < implementz.length; j++) {
                implementzTypes[j] = new Type(implementz[j]);
            }
            innerClass.setImplementz(implementzTypes);

            method = new JavaMethod(retVal.asType(), "underlying");
            method.setModifiers(new String[]{"private"});
            innerClass.addMethod(method);

            for (int j = 0; (fields != null) && (j < fields.length); j++) {
                ValueObjectFieldMetadata vField = fields[j];
                method = new JavaMethod(vField.getProperty().getType(), vField.getProperty().getAccessor().getName());
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);

                method = new JavaMethod(new Type("boolean"), vField.getProperty().getName()+"HasBeenSet");
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);
            }

            for (int k = 0; k < nonCollectionRel.length; k++) {
                ValueObjectRelationMetadata nonColRel = nonCollectionRel[k];

                method = new JavaMethod(nonColRel.getProperty().getType(), nonColRel.getProperty().getAccessor().getName());
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);

                method = new JavaMethod(new Type("boolean"), nonColRel.getProperty().getName()+"HasBeenSet");
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);
            }

            for (int k = 0; k < collectionRel.length; k++) {
                ValueObjectRelationMetadata colRel = collectionRel[k];

                method = new JavaMethod(colRel.getProperty().getType(), "getAdded" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);
                method = new JavaMethod(colRel.getProperty().getType(), "getOnceAdded" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);
                method = new JavaMethod(colRel.getProperty().getType(), "getRemoved" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);
                method = new JavaMethod(colRel.getProperty().getType(), "getUpdated" + colRel.getProperty().getName());
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);

                method = new JavaMethod(colRel.getProperty().getType(), colRel.getProperty().getAccessor().getName()+"Collection");
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);

                method = new JavaMethod(new Type(colRel.getAggregate(),1), colRel.getProperty().getAccessor().getName());
                method.setModifiers(new String[]{"public"});
                innerClass.addMethod(method);
            }

            method = new JavaMethod(new Type("int"), "hashCode");
            method.setModifiers(new String[]{"public"});
            innerClass.addMethod(method);

            method = new JavaMethod(new Type("boolean"), "equals");
            method.setModifiers(new String[]{"public"});
            method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.lang.Object"), "other")});
            innerClass.addMethod(method);

            if (metaVo.isStrictOrdering()) {
                method = new JavaMethod(new Type("int"), "compareTo");
                method.setModifiers(new String[]{"public"});
                method.setParameters(new JavaParameter[]{new JavaParameter(new Type("java.lang.Object"), "other")});
                innerClass.addMethod(method);
            }

            // add to list
            retLst.add(retVal);
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

            retVal = new BeanProperty(propName);
            retVal.setType(propType);
            JavaMethod getter = new JavaMethod(propType, getGetterName(retVal));
            JavaMethod setter = new JavaMethod(propType, getSetterName(retVal));
            setter.setParameters(new JavaParameter[] {new JavaParameter(propType, propName)});
            retVal.setAccessor(getter);
            retVal.setMutator(setter);
            return retVal;
        }
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

            this.metaFlags = metaFlags;
            this.property = new BeanProperty(propertyName);
            this.property.setType(propertyType);
            JavaMethod getter = new JavaMethod(propertyType, getGetterName(this.property));
            JavaMethod setter = new JavaMethod(propertyType, getSetterName(this.property));
            setter.setParameters(new JavaParameter[] {new JavaParameter(propertyType, propertyName)});
            this.property.setAccessor(getter);
            this.property.setMutator(setter);
        }
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

            method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
            method.setReturns(new Type("javax.jms.Queue"));
            retVal.addMethod(method);
            method = new JavaMethod("getQueue");
            method.setModifiers(new String[] { "public", "static" });
            method.setParameters(new JavaParameter[] { new JavaParameter(new Type("java.util.Hashtable"),
                    "environment") });
            method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
            method.setReturns(new Type("javax.jms.Queue"));
            retVal.addMethod(method);
            method = new JavaMethod("getQueueConnection");
            method.setModifiers(new String[] { "public", "static" });
            method.setExceptions(new Type[] { new Type("javax.naming.NamingException"),
                    new Type("javax.jms.JMSException") });
            method.setReturns(new Type("javax.jms.QueueConnection"));
            retVal.addMethod(method);
            method = new JavaMethod("getQueueConnection");
            method.setModifiers(new String[] { "public", "static" });
            method.setParameters(new JavaParameter[] { new JavaParameter(new Type("java.util.Hashtable"),
                    "environment") });
            method.setExceptions(new Type[] { new Type("javax.naming.NamingException"),
                    new Type("javax.jms.JMSException") });
            method.setReturns(new Type("javax.jms.QueueConnection"));
            retVal.addMethod(method);
        } else {
            if (hasRemoteView(metadata)) {
                method = new JavaMethod("getHome");
                method.setModifiers(new String[] { "public", "static" });
                method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
                method
                        .setReturns(new Type(getRemoteHomeInterfacePlugin().getVirtualType(metadata)
                                .toString()));
                retVal.addMethod(method);
                method = new JavaMethod("getHome");
                method.setModifiers(new String[] { "public", "static" });
                method.setParameters(new JavaParameter[] { new JavaParameter(new Type("java.util.Hashtable"),
                        "env") });
                method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
                method
                        .setReturns(new Type(getRemoteHomeInterfacePlugin().getVirtualType(metadata)
                                .toString()));
                retVal.addMethod(method);
            }
            if (hasLocalView(metadata)) {
                method = new JavaMethod("getLocalHome");
                method.setModifiers(new String[] { "public", "static" });
                method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
                method
                        .setReturns(new Type(getLocalHomeInterfacePlugin().getVirtualType(metadata)
                                .toString()));
                retVal.addMethod(method);
                method = new JavaMethod("getLocalHome");
                method.setModifiers(new String[] { "public", "static" });
                method.setParameters(new JavaParameter[] { new JavaParameter(new Type("java.util.Hashtable"),
                        "env") });
                method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
                method
                        .setReturns(new Type(getLocalHomeInterfacePlugin().getVirtualType(metadata)
                                .toString()));
                retVal.addMethod(method);
            }
            method = new JavaMethod("lookupHome");
            method.setModifiers(new String[] { "private", "static" });
            method.setParameters(new JavaParameter[] {
                    new JavaParameter(new Type("java.util.Hashtable"), "env"),
                    new JavaParameter(new Type("java.lang.String"), "jndiName"),
                    new JavaParameter(new Type("java.lang.Class"), "narrowTo") });
            method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
            method.setReturns(new Type("java.lang.Object"));
            retVal.addMethod(method);
        }

        method = new JavaMethod("lookup");
        method.setModifiers(new String[] { "public", "static" });
        method.setParameters(new JavaParameter[] { new JavaParameter(new Type("java.util.Hashtable"), "env"),
                new JavaParameter(new Type("java.lang.String"), "jndiName") });
        method.setExceptions(new Type[] { new Type("javax.naming.NamingException") });
        method.setReturns(new Type("java.lang.Object"));
        retVal.addMethod(method);

        if (isIncludeGUID()) {
            method = new JavaMethod("generateGUID");
            method.setModifiers(new String[] { "public", "final", "static" });
            method.setParameters(new JavaParameter[] {

            new JavaParameter(new Type("java.lang.Object"), "o") });

            method.setReturns(new Type("java.lang.String"));
            retVal.addMethod(method);
            field = new JavaField(new Type("java.lang.String"), "hexServerIP");
            field.setModifiers(new String[] { "private", "static" });
            retVal.addField(field);
            field = new JavaField(new Type("java.security.SecureRandom"), "seeder");
            field.setModifiers(new String[] { "private", "final", "static" });
            retVal.addField(field);
            method = new JavaMethod("hexFormat");
            method.setModifiers(new String[] { "private", "static" });
            method.setParameters(new JavaParameter[] {

            new JavaParameter(new Type("byte", 1), "value"), new JavaParameter(new Type("int"), "length") });

            method.setReturns(new Type("java.lang.String"));
            retVal.addMethod(method);
            method = new JavaMethod("hexFormat");
            method.setModifiers(new String[] { "private", "static" });
            method.setParameters(new JavaParameter[] {

            new JavaParameter(new Type("int"), "value"), new JavaParameter(new Type("int"), "length") });

            method.setReturns(new Type("java.lang.String"));
            retVal.addMethod(method);
        }
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

        {
            if ( javaMethod.getParameters() != null )
            {
                for ( int i = 0; i < javaMethod.getParameters().length; i++ )
                {
                    JavaParameter javaParameter = javaMethod.getParameters()[i];

                    separatorAdded = appendDefaultParamTag( sb, indent, separatorAdded, javaParameter );
                }
            }
            // is generic?
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaParameter

            }
            return;
        }

        boolean found = false;
        JavaParameter javaParam = javaMethod.getParameterByName( paramName );
        if ( javaParam == null )
        {
            // is generic?
            TypeVariable[] typeParams = javaMethod.getTypeParameters();
            for ( int i = 0; i < typeParams.length; i++ )
            {
                if ( typeParams[i].getGenericValue().equals( paramName ) )
                {
                    found = true;
                }
            }
        }
        else
        {
            found = true;
        }

        if ( !found )
        {
            if ( getLog().isWarnEnabled() )
            {
                getLog().warn(
                    "Fixed unknown param '" + paramName + "' defined in " + getJavaMethodAsString( javaMethod ) );
            }

            if ( sb.toString().endsWith( EOL ) )
            {
                sb.delete( sb.toString().lastIndexOf( EOL ), sb.toString().length() );
            }
        }
        else
        {
            String originalJavadocTag = javaEntityTags.getJavadocParamTag( paramName );
            if ( originalJavadocTag != null )
            {
                sb.append( originalJavadocTag );
                String s = "@" + PARAM_TAG + " " + paramName;
                if ( StringUtils.removeDuplicateWhitespace( originalJavadocTag ).trim().endsWith( s ) )
                {
                    sb.append( " " );
                    sb.append( getDefaultJavadocForType( javaParam.getType() ) );
                }
            }
        }
    }
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.