Examples of countTokens()


Examples of java.util.StringTokenizer.countTokens()

    ArrayCustConverterObjPrime dest = mapper.map(src, ArrayCustConverterObjPrime.class);

    // Custom converter specified for the field1 mapping, so verify custom converter was actually used
    assertNotNull("dest field1 should not be null", dest.getField1Prime());
    StringTokenizer st = new StringTokenizer(dest.getField1Prime(), "-");
    assertEquals("dest field1 value should contain a hyphon", 2, st.countTokens());
    st.nextToken();
    String token2 = st.nextToken();
    assertEquals("dest field1 value should have been appended to by the cust converter",
        StringAppendCustomConverter.APPENDED_VALUE, token2);
  }
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

    SimpleObjPrime2 dest = mapper.map(src, SimpleObjPrime2.class);

    // Custom converter specified for the field1 mapping, so verify custom converter was actually used
    assertNotNull("dest field1 should not be null", dest.getField1Prime());
    StringTokenizer st = new StringTokenizer(dest.getField1Prime(), "-");
    assertEquals("dest field1 value should contain a hyphon", 2, st.countTokens());
    String token1 = st.nextToken();
    assertEquals("1st portion of dest field1 value should equal src field value", src.getField1(), token1);
    String token2 = st.nextToken();
    assertEquals("dest field1 value should have been appended to by the cust converter",
        StringAppendCustomConverter.APPENDED_VALUE, token2);
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

    SimpleObjPrime2 dest = mapper.map(src, SimpleObjPrime2.class);

    // Custom converter specified for the field1 mapping, so verify custom converter was actually used
    assertNotNull("dest field1 should not be null", dest.getField1Prime());
    StringTokenizer st = new StringTokenizer(dest.getField1Prime(), "-");
    assertEquals("dest field1 value should contain a hyphon", 2, st.countTokens());
    String token1 = st.nextToken();
    assertEquals("dest field1 value should contain the explicit null string", "null", token1);
    String token2 = st.nextToken();
    assertEquals("dest field1 value should have been appended to by the cust converter",
        StringAppendCustomConverter.APPENDED_VALUE, token2);
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

    SimpleObj dest = mapper.map(src, SimpleObj.class);

    // Custom converter specified for the field1 mapping, so verify custom converter was actually used
    assertNotNull("dest field1 should not be null", dest.getField1());
    StringTokenizer st = new StringTokenizer(dest.getField1(), "-");
    assertEquals("dest field1 value should contain a hyphon", 2, st.countTokens());
    String token1 = st.nextToken();
    assertEquals("1st portion of dest field1 value should equal src field value", src.getValue("fieldA"), token1);
    String token2 = st.nextToken();
    assertEquals("dest field1 value should have been appended to by the cust converter",
        StringAppendCustomConverter.APPENDED_VALUE, token2);
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

    SimpleObj dest = mapper.map(src, SimpleObj.class);

    // Custom converter specified for the field1 mapping, so verify custom converter was actually used
    assertNotNull("dest field1 should not be null", dest.getField1());
    StringTokenizer st = new StringTokenizer(dest.getField1(), "-");
    assertEquals("dest field1 value should contain a hyphon", 2, st.countTokens());
    String token1 = st.nextToken();
    assertEquals("1st portion of dest field1 value should equal src field value", src.getHashMap().get("fieldA"), token1);
    String token2 = st.nextToken();
    assertEquals("dest field1 value should have been appended to by the cust converter",
        StringAppendCustomConverter.APPENDED_VALUE, token2);
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

    AnotherTestObject dest = mapper.map(src, AnotherTestObject.class);

    // Custom converter specified for the field1 mapping, so verify custom converter was actually used
    assertNotNull("dest field1 should not be null", dest.getField3());
    StringTokenizer st = new StringTokenizer(dest.getField3(), "-");
    assertEquals("dest field1 value should contain a hyphon", 2, st.countTokens());
    String token1 = st.nextToken();
    assertEquals("1st portion of dest field1 value should equal src field value", src.getField1(), token1);
    String token2 = st.nextToken();
    assertEquals("custom converter param should have been appended to by the cust converter", "CustomConverterParamTest", token2);
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

  private static String [] getCipherList() throws Exception {
    String cipherList = System.getProperty(CIPHER,null);
    String[] cipherTable = null;
    if ( cipherList != null ) {
      StringTokenizer tokenizer = new StringTokenizer( cipherList,",");
      int tokens = tokenizer.countTokens();
      if (tokens > 0) {
        cipherTable = new String[tokens];
        while(tokenizer.hasMoreElements())
          cipherTable[--tokens] = tokenizer.nextToken();
      }
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

        if(fqn == null || root == null)
            return;
        curr=root;
        tok=new StringTokenizer(fqn, "/");

        while(tok.countTokens() > 1) {
            child_name=tok.nextToken();
            n=curr.findChild(child_name);
            if(n == null) // node does not exist
                return;
            curr=n;
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

        } else {
            listTypes = argument.substring(spIndex + 1);
   
            // parse all the type tokens
            StringTokenizer st = new StringTokenizer(listTypes, ";");
            types = new String[st.countTokens()];
            for (int i = 0; i < types.length; ++i) {
                types[i] = st.nextToken();
            }
        }
        // set the list types
View Full Code Here

Examples of java.util.StringTokenizer.countTokens()

        return buf.toString();
    }

    public static byte[] decodeMacAddress(final String mac) {
        final StringTokenizer tokens = new StringTokenizer(mac, "-");
        if(tokens.countTokens() != MAC_ADDRESS_TOKENS) {
            throw new IllegalArgumentException("Unexpected mac address representation: " + mac);
        }
        final StringBuilder buf = new StringBuilder(MAC_ADDRESS_TOKENS * 2);
        for(int i = 0; i < MAC_ADDRESS_TOKENS; i++) {
            buf.append(tokens.nextToken());
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.