Examples of GString


Examples of groovy.lang.GString

        assertEquals("Should have just 1 item left: " + list, 1, list.size());
    }

    public void testCoerceGStringToString() throws Throwable {
        GString param = new GString(new Object[]{"James"}) {
            public String[] getStrings() {
                return new String[]{"Hello "};
            }
        };
        Object value = invoke(this, "methodTakesString", new Object[]{param});
        assertEquals("converted GString to string", param.toString(), value);
    }
View Full Code Here

Examples of groovy.lang.GString

        Object value = invoke(this, "methodTakesString", new Object[]{param});
        assertEquals("converted GString to string", param.toString(), value);
    }

    public void testCoerceGStringToStringOnGetBytes() throws Throwable {
        GString param = new GString(new Object[]{"US-ASCII"}) {
            public String[] getStrings() {
                return new String[]{""};
            }
        };
        Object value = invoke("test", "getBytes", new Object[]{param});
View Full Code Here

Examples of groovy.lang.GString

    public final void print(Object o) {
        try {
            if (o instanceof Text) {
                write((Text) o);
            } else if (o instanceof GString) {
                GString gs = (GString) o;
                Object[] values = gs.getValues();
                for (int i = 0; i < values.length; i++) {
                    values[i] = format(values[i]);
                }
                write(o.toString());
            } else {
View Full Code Here

Examples of groovy.lang.GString

    }
  }

  public final void print(Object o) throws IOException {
    if (o instanceof GString) {
      GString gs = (GString)o;
      Object[] values = gs.getValues();
      for (int i = 0;i < values.length;i++) {
        values[i] = format(values[i]);
      }
      renderContext.getPrinter().provide(Chunk.create(o.toString()));
    }
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.