Examples of MInput


Examples of org.apache.sqoop.model.MInput

      JSONObject input = (JSONObject) inputs.get(i);
      MInputType type =
          MInputType.valueOf((String) input.get(FORM_INPUT_TYPE));
      String name = (String) input.get(FORM_INPUT_NAME);
      Boolean sensitive = (Boolean) input.get(FORM_INPUT_SENSITIVE);
      MInput mInput = null;
      switch (type) {
        case STRING: {
          long size = (Long) input.get(FORM_INPUT_SIZE);
          mInput = new MStringInput(name, sensitive.booleanValue(), (short) size);
          break;
        }
        case MAP: {
          mInput = new MMapInput(name, sensitive.booleanValue());
          break;
        }
        case INTEGER: {
          mInput = new MIntegerInput(name, sensitive.booleanValue());
          break;
        }
        case ENUM: {
          String values = (String) input.get(FORM_INPUT_VALUES);
          mInput = new MEnumInput(name, sensitive.booleanValue(), values.split(","));
          break;
        }
      }

      // Propagate form ID
      mInput.setPersistenceId((Long)input.get(ID));

      // Propagate form optional value
      if(input.containsKey(FORM_INPUT_VALUE)) {
        mInput.restoreFromUrlSafeValueString(
          (String) input.get(FORM_INPUT_VALUE));
      }
      mInputs.add(mInput);
    }
View Full Code Here

Examples of org.apache.sqoop.model.MInput

  protected List<MForm> getForms() {
    List<MForm> forms = new LinkedList<MForm>();

    List<MInput<?>> inputs;
    MInput input;

    inputs = new LinkedList<MInput<?>>();
    input = new MStringInput("I1", false, (short)30);
    inputs.add(input);
    input = new MStringInput("I2", false, (short)30);
View Full Code Here

Examples of org.apache.sqoop.model.MInput

        String inputEnumValues = rsetInput.getString(8);
        String value = rsetInput.getString(9);

        MInputType mit = MInputType.valueOf(inputType);

        MInput input = null;
        switch (mit) {
        case STRING:
          input = new MStringInput(inputName, inputSensitivity, inputStrLength);
          break;
        case MAP:
          input = new MMapInput(inputName, inputSensitivity);
          break;
        case INTEGER:
          input = new MIntegerInput(inputName, inputSensitivity);
          break;
        case ENUM:
          input = new MEnumInput(inputName, inputSensitivity, inputEnumValues.split(","));
          break;
        default:
          throw new SqoopException(DerbyRepoError.DERBYREPO_0006,
              "input-" + inputName + ":" + inputId + ":"
              + "form-" + inputForm + ":" + mit.name());
        }

        // Set persistent ID
        input.setPersistenceId(inputId);

        // Set value
        if(value == null) {
          input.setEmpty();
        } else {
          input.restoreFromUrlSafeValueString(value);
        }

        if (mf.getInputs().size() != inputIndex) {
          throw new SqoopException(DerbyRepoError.DERBYREPO_0009,
            "form: " + mf
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.