Examples of ValueEncoder


Examples of com.adgear.anoa.avro.encode.ValueEncoder

   * @param recordSchema The Schema of the records returned by the given upstream Provider.
   */
  public AvroGenericToValue(Provider<GenericRecord> provider, Schema recordSchema) {
    super(provider,
          recordSchema,
          new ValueEncoder(),
          new GenericDatumTextWriter<GenericRecord>(recordSchema));
    writer.withFieldNames();
  }
View Full Code Here

Examples of com.adgear.anoa.avro.encode.ValueEncoder

public class AvroSpecificToValue<R extends IndexedRecord> extends AvroToSchemalessBase<R, Value> {

  public AvroSpecificToValue(AvroProvider<R> provider) {
    super(provider,
          provider.getAvroSchema(),
          new ValueEncoder(),
          new SpecificDatumTextWriter<R>(provider.getAvroSchema()));
    writer.withFieldNames();
  }
View Full Code Here

Examples of com.adgear.anoa.avro.encode.ValueEncoder

   * @param recordClass The class object of the records returned by the given upstream Provider.
   */
  public AvroSpecificToValue(Provider<R> provider, Class<R> recordClass) {
    super(provider,
          SpecificData.get().getSchema(recordClass),
          new ValueEncoder(),
          new SpecificDatumTextWriter<R>(recordClass));
    writer.withFieldNames();
  }
View Full Code Here

Examples of org.apache.tapestry.ValueEncoder

    public String toClient(Object value)
    {
        Defense.notNull(value, "value");

        ValueEncoder encoder = _valueEncoderSource.getValueEncoder(value.getClass());

        return encoder.toClient(value);
    }
View Full Code Here

Examples of org.apache.tapestry.ValueEncoder

public class ContextValueEncoderImplTest extends InternalBaseTestCase
{
    @Test
    public void to_client()
    {
        ValueEncoder valueEncoder = mockValueEncoder();
        ValueEncoderSource source = mockValueEncoderSource();

        Long value = 23L;
        String encoded = "twentythree";
View Full Code Here

Examples of org.apache.tapestry.ValueEncoder


    @Test
    public void to_value()
    {
        ValueEncoder valueEncoder = mockValueEncoder();
        ValueEncoderSource source = mockValueEncoderSource();

        Long value = 23L;
        String clientValue = "twentythree";
View Full Code Here

Examples of org.apache.tapestry.ValueEncoder

        if (selected == null)
            selected = newList();
        else
            selected.clear();

        ValueEncoder encoder = _encoder;

        if (InternalUtils.isNonBlank(values))
        {
            for (String value : values.split(";"))
            {
                Object objectValue = encoder.toValue(value);

                selected.add(objectValue);
            }
        }
View Full Code Here

Examples of org.apache.tapestry.ValueEncoder

        if (selected == null)
            selected = newList();
        else
            selected.clear();

        ValueEncoder encoder = _encoder;

        if (InternalUtils.isNonBlank(values))
        {
            for (String value : values.split(";"))
            {
                Object objectValue = encoder.toValue(value);

                selected.add(objectValue);
            }
        }
View Full Code Here

Examples of org.apache.tapestry5.ValueEncoder

        // Assumption: the field type is not one that's loaded by the component class loader, so it's safe
        // to convert to a hard type during class transformation.

        Class fieldType = classCache.forName(field.getTypeName());

        ValueEncoder encoder = valueEncoderSource.getValueEncoder(fieldType);

        FieldHandle handle = field.getHandle();

        String fieldName = String.format("%s.%s", field.getPlasticClass().getClassName(), field.getName());
View Full Code Here

Examples of org.apache.tapestry5.ValueEncoder

                                "The value for query parameter '%s' was blank, but a non-blank value is needed.",
                                parameterName));

                    Class parameterType = classCache.forName(parameterTypeName);

                    ValueEncoder valueEncoder = valueEncoderSource.getValueEncoder(parameterType);

                    Object value = valueEncoder.toValue(parameterValue);

                    if (parameterType.isPrimitive() && value == null)
                        throw new RuntimeException(
                                String.format(
                                        "Query parameter '%s' evaluates to null, but the event method parameter is type %s, a primitive.",
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.