Exemple #1
0
  /**
   * Write the variable's declaration in a C-style syntax. This function is used to create textual
   * representation of the Data Descriptor Structure (DDS). See <em>The OPeNDAP User Manual</em> for
   * information about this structure.
   *
   * @param os The <code>PrintWriter</code> on which to print the declaration.
   * @param space Each line of the declaration will begin with the characters in this string.
   *     Usually used for leading spaces.
   * @param print_semi a boolean value indicating whether to print a semicolon at the end of the
   *     declaration.
   * @param constrained a boolean value indicating whether to print the declartion dependent on the
   *     projection information. <b>This is only used by Server side code.</b>
   * @see DDS
   */
  public void printDecl(PrintWriter os, String space, boolean print_semi, boolean constrained) {
    if (constrained && !isProject()) return;

    // BEWARE! Since printDecl()is (multiple) overloaded in BaseType
    // and all of the different signatures of printDecl() in BaseType
    // lead to one signature, we must be careful to override that
    // SAME signature here. That way all calls to printDecl() for
    // this object lead to this implementation.

    // Also, since printDecl()is (multiple) overloaded in BaseType
    // and all of the different signatures of printDecl() in BaseType
    // lead to the signature we are overriding here, we MUST call
    // the printDecl with the SAME signature THROUGH the super class
    // reference (assuming we want the super class functionality). If
    // we do otherwise, we will create an infinte call loop. OOPS!

    super.printDecl(os, space, print_semi, constrained);
  }
Exemple #2
0
  public void printJSON(PrintWriter os, String space, boolean print_comma, boolean constrained) {
    if (constrained && !isProject()) return;

    super.printJSON(os, space, print_comma, constrained);
  }
Exemple #3
0
 /**
  * Prints the value of the variable, with its declaration. This function is primarily intended for
  * debugging OPeNDAP applications and text-based clients such as geturl.
  *
  * <p>
  *
  * <h2>Important Note</h2>
  *
  * This method overrides the BaseType method of the same name and type signature and it
  * significantly changes the behavior for all versions of <code>printVal()</code> for this type:
  * <b><i> All the various versions of printVal() will only print a value, or a value with
  * declaration, if the variable is in the projection.</i></b> <br>
  * <br>
  * In other words, if a call to <code>isProject()</code> for a particular variable returns <code>
  * true</code> then <code>printVal()</code> will print a value (or a declaration and a value).
  * <br>
  * <br>
  * If <code>isProject()</code> for a particular variable returns <code>false</code> then <code>
  * printVal()</code> is basically a No-Op. <br>
  * <br>
  *
  * @param os the <code>PrintWriter</code> on which to print the value.
  * @param space this value is passed to the <code>printDecl</code> method, and controls the
  *     leading spaces of the output.
  * @param print_decl_p a boolean value controlling whether the variable declaration is printed as
  *     well as the value.
  * @see BaseType#printVal(PrintWriter, String, boolean)
  * @see ServerMethods#isProject()
  */
 public void printVal(PrintWriter os, String space, boolean print_decl_p) {
   if (!isProject()) return;
   super.printVal(os, space, print_decl_p);
 }
Exemple #4
0
 /* (non-Javadoc)
  * @see opendap.dap.DFloat32#printAttributesJSON(java.io.PrintWriter)
  */
 @Override
 public void printAttributesJSON(PrintWriter os) {
   // TODO Auto-generated method stub
   super.printAttributesJSON(os);
 }