Package com.volantis.mcs.build.javadoc

Examples of com.volantis.mcs.build.javadoc.ConstructorInfo


    List constructors = classInfo.getConstructors ();
    if (constructors.size () != 1) {
      throw new IllegalStateException ("Must be one constructor");
    }

    ConstructorInfo constructorInfo = (ConstructorInfo) constructors.get (0);
    List parameters = constructorInfo.getParameters ();

    // If the number of parameters is not the same as the total number of
    // fields then error.
    if (parameters.size () != fields.size ()) {
      throw new IllegalStateException ("Not enough parameters in constructor"
View Full Code Here


                                                   field.getName (),
                                                   field.getType ());
      constructorParameters.add (parameter);
    }
   
    ConstructorInfo constructor = new ConstructorInfo (constructorParameters);
    identityClassInfo.addConstructor (constructor);

    // Get the list of extra identity fields.
    if (guardianInfo == null) {
      extraIdentityFields = new ArrayList (allIdentityFields);
View Full Code Here

    }

    // Iterate over all constructors and replicate them in this class
    for (Iterator i = baseConstructors.iterator(); i.hasNext(); /* No ++ */) {

        ConstructorInfo baseConstructor = (ConstructorInfo)i.next();

        // Write the constructor comment.
        GenerateUtilities.openJavaDocComment(out, "  ");
        GenerateUtilities.addJavaDocComment(out, "  ", "Create a new <code>"
                + identityClassName + "</code>.");
        List constructorParameters = baseConstructor.getParameters();
        for (Iterator innerI = constructorParameters.iterator();
                                            innerI.hasNext(); /* No ++ */) {
            ParameterInfo param = (ParameterInfo)innerI.next();
            String paramName = param.getName();
            comment = "@param " + paramName + " " +
                    identityBaseClassInfo.getField(paramName, true).getComment();

            GenerateUtilities.addJavaDocComment(out, "  ", comment);
        }
        GenerateUtilities.closeJavaDocComment(out, "  ");

        // Write the constructor method declaration.
        String startLine = "  public " + identityClassName + " (";
        out.print(startLine);
        separator = null;
        for (Iterator innerI = constructorParameters.iterator();
                                            innerI.hasNext(); /* No ++ */) {
            ParameterInfo param = (ParameterInfo)innerI.next();

            // Output a parameter declaration.
            if (separator == null) {
                separator = ",\n" +
                        GenerateUtilities.getIndent(startLine.length());
            } else {
                out.print(separator);
            }
            out.print (param.getTypeName() + " " + param.getName());
        }
        if (identityFields.size () != 0) {
            for (Iterator fieldsIterator = identityFields.iterator();
                 fieldsIterator.hasNext(); /**/) {
                FieldInfo field = (FieldInfo)fieldsIterator.next();

                if (separator == null){
                    separator = ",\n" +
                             GenerateUtilities.getIndent(startLine.length());
                } else {
                    out.print(separator);
                }

                out.print (field.getTypeName() + " " + field.getName());
            }
        }
        out.println(") {");



        List parameters = baseConstructor.getParameters();
        ParameterInfo firstParam = (ParameterInfo) parameters.get(0);
       
        // If the Project is the first parameter, call the superclass
        // constructor.  If it isn't, call the superclass constructor with
        // null for the project.
View Full Code Here

    List constructors = dstClassInfo.getConstructors ();
    if (constructors.size () != 1) {
      throw new IllegalStateException ("Must be one constructor");
    }

    ConstructorInfo constructorInfo = (ConstructorInfo) constructors.get (0);
    List parameters = constructorInfo.getParameters ();

      String params = "";
      for (Iterator i = parameters.iterator(); i.hasNext(); /**/) {
          params += ((ParameterInfo)i.next()).getName();
          params += " ";
View Full Code Here

TOP

Related Classes of com.volantis.mcs.build.javadoc.ConstructorInfo

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.