Examples of clean()


Examples of javango.forms.fields.EmailField.clean()

    field.setName("fieldName");
    field.setRequired(false);

    Map<String, String> errors = new HashMap<String, String>();
   
    String value = field.clean(new String[]{""}, errors);
    assertTrue(errors.isEmpty());
  }
 
}
View Full Code Here

Examples of javango.forms.fields.Field.clean()

    choices.put(2L, "Paul");
    Field f = (injector.getInstance(LongSelectField.class)).setChoices(choices).setName("choice_field");
   
    Map<String, String> errors = new HashMap<String, String>();
   
    assertEquals(1L, f.clean(new String[]{"1"}, errors));
    assertTrue(errors.isEmpty());

   
    errors = new HashMap<String, String>();
    f.clean(new String[]{"John"}, errors);
View Full Code Here

Examples of javango.forms.fields.IntegerField.clean()

    Field field = new IntegerField(injector.getInstance(WidgetFactory.class));
    field.setName("fieldName");

    Map<String, String> errors = new HashMap<String, String>();
   
    Long value = (Long)field.clean(new String[]{""}, errors);
    assertFalse(errors.isEmpty());
    assertTrue(errors.containsKey(field.getName()));
    assertEquals("Required", errors.get(field.getName()));
    // Integer number not valid
  }
View Full Code Here

Examples of javango.forms.fields.PercentField.clean()

    PercentField field = injector.getInstance(PercentField.class);
    field.setName("fieldName");

    Map<String, String> errors = new HashMap<String, String>();
   
    Double value = field.clean(new String[]{""}, errors);
    assertFalse(errors.isEmpty());
    assertTrue(errors.containsKey(field.getName()));
    assertEquals(AbstractField.REQUIRED_ERROR, errors.get(field.getName()));
  }
 
View Full Code Here

Examples of jm.music.data.Score.clean()

        Phrase phr = new Phrase(0.0);
        Score scr = new Score();
        if (fileName != null) {
            Read.midi(scr, loadMidi.getDirectory() + fileName);
        }
        scr.clean();
        if (scr.size() > 0 && scr.getPart(0).size() > 0) phr = scr.getPart(0).getPhrase(0);
        //System.out.println("Size = " + phr.size());
        return phr;
    }
View Full Code Here

Examples of net.matuschek.util.ByteBuffer.clean()

  }
  buff.append((byte)i);
      }

      String httpCode = lineString(buff.getContent());
      buff.clean();
      doc.setHttpCode(httpCode);


      // read the HTTP headers
      boolean finishedHeaders = false;
View Full Code Here

Examples of net.matuschek.util.ByteBuffer.clean()

  }
  // HTTP header processing
  if (i == LF) {
    String line = lineString(buff.getContent());
   
    buff.clean();
    // empty line means "end of headers"
    if (line.trim().equals("")) {
      finishedHeaders = true;
    } else {
      HttpHeader head = new HttpHeader(line);
View Full Code Here

Examples of net.matuschek.util.ByteBuffer.clean()

      }

    }
  }
      }
      buff.clean();

      // if there is a DownloadRule, ask if we should download
      // the data
      if (downloadRules != null) {
    // if it is not allowed to download this URL, close socket
View Full Code Here

Examples of no.priv.garshol.duke.Cleaner.clean()

    String prop = col.getProperty();
    Cleaner cleaner = col.getCleaner();
    if (col.isSplit()) {
      for (String v : col.split(value)) {
        if (cleaner != null)
          v = cleaner.clean(v);
        if (v != null && !v.equals(""))
          record.addValue(prop, v);
      }
    } else {
      if (cleaner != null)
View Full Code Here

Examples of no.priv.garshol.duke.cleaners.RegexpCleaner.clean()

  }

  private void test(String regexp, String value, String result) {
    RegexpCleaner cl = new RegexpCleaner();
    cl.setRegexp(regexp);
    assertEquals(result, cl.clean(value));
  }
}
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.