{@inheritDoc}

@throws SuperCsvCellProcessorException
if value is null, not the correct type, or can't be formatted
544005
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		if (!(value.getClass().equals(jodaClass))) {
			throw new SuperCsvCellProcessorException(jodaClass, value, context,
					this);
		}
		final T jodaType = jodaClass.cast(value);
		try {
			if (formatter != null) {
				return format(jodaType, formatter);
			} else if (pattern != null) {
				return format(jodaType, pattern, locale);
			} else {
				return format(jodaType);
			}
		} catch (IllegalArgumentException e) {
			throw new SuperCsvCellProcessorException(
					String.format("Failed to format value as a %s",
							jodaClass.getSimpleName()), context, this, e);
		}
	}
301213
@Override
    protected TextFormatter<T> getDefaultFormatter(final FieldAccessor field, final Configuration config) {
        
        throw new SuperCsvInvalidAnnotationException(MessageBuilder.create("anno.required")
                .var("property", field.getNameWithClass())
                .varWithAnno("anno", CsvFormat.class)
                .format());
    }
1008555
static public function subclassOf($value, $className, $message = null, $propertyPath = null)
        {
            if (!is_subclass_of($value, $className)) {
                $message = $message ?: sprintf(
                    'Class "%s" was expected to be subclass of "%s".',
                    static::stringify($value),
                    $className
                );

                throw static::createException($value, $message, static::INVALID_SUBCLASS_OF, $propertyPath, array('class' => $className));
            }
        }
747275
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		if (!(value instanceof Interval)) {
			throw new SuperCsvCellProcessorException(Interval.class, value,
					context, this);
		}
		final Interval interval = (Interval) value;
		final String result = interval.toString();
		return next.execute(result, context);
	}
540572
public function marshal($value)
    {
        if ($value === null) {
            return null;
        }
        if ($value === 'true') {
            return true;
        }
        if ($value === 'false') {
            return false;
        }
        if (!is_scalar($value)) {
            return null;
        }

        return !empty($value);
    }
454210
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		if( !possibleValues.contains(value) ) {
			throw new SuperCsvConstraintViolationException(String.format(
				"'%s' is not included in the allowed set of values", value), context, this);
		}
		
		return next.execute(value, context);
	}
883978
@Override public Object transform(Object value) {
        if (value == null) {
            return value;
        } else if (value instanceof Boolean) {
            return value;
        } else if (value instanceof String) {
            return value;
        } else if (value instanceof Number) {
            return InternalUtils.toBigDecimal((Number)value);
        } else if (value instanceof byte[]) {
            return value;
        } else if (value instanceof ByteBuffer) {
            return copyBytesFrom((ByteBuffer)value);
        } else if (value instanceof Set) {
            @SuppressWarnings("unchecked")
            Set<Object> set = (Set<Object>) value;
            if (set.size() == 0)
                return value;
            Object element = set.iterator().next();
            if (element instanceof String) {
                return value;
            } else if (element instanceof BigDecimal) {
                return value;
            } else if (element instanceof Number) {
                @SuppressWarnings("unchecked")
                Set<Number> in = (Set<Number>) value;
                Set<BigDecimal> out = new LinkedHashSet<BigDecimal>(set.size());
                for (Number n : in)
                    out.add(InternalUtils.toBigDecimal(n));
                return out;
            } else if (element instanceof byte[]) {
                return value;
            } else if (element instanceof ByteBuffer) {
                @SuppressWarnings("unchecked")
                Set<ByteBuffer> bs = (Set<ByteBuffer>) value;
                Set<byte[]> out = new LinkedHashSet<byte[]>(bs.size());
                for (ByteBuffer bb: bs)
                    out.add(copyBytesFrom(bb));
                return out;
            } else {
                throw new UnsupportedOperationException("element type: "
                        + element.getClass());
            }
        } else if (value instanceof List) {
            @SuppressWarnings("unchecked")
            List<Object> in = (List<Object>) value;
            if (in.size() == 0)
                return in;
            List<Object> out = new ArrayList<Object>();
            for (Object v : in)
                out.add(transform(v));
            return out;
        } else if (value instanceof Map) {
            @SuppressWarnings("unchecked")
            Map<String, Object> in = (Map<String, Object>) value;
            if (in.size() == 0)
                return in;
            Map<String, Object> out = new LinkedHashMap<String, Object>(in.size());
            for (Map.Entry<String, Object> e : in.entrySet())
                out.put(e.getKey(), transform(e.getValue()));
            return out;
        } else {
            throw new UnsupportedOperationException("value type: "
                    + value.getClass());
        }
    }
76509
private void convertValue() throws JspException {

        if ((type == null) || (type.equalsIgnoreCase(TIMESTAMP_TYPE))) {
            if (!(value instanceof java.sql.Timestamp)) {
                value = new java.sql.Timestamp(value.getTime());
            }
        } else if (type.equalsIgnoreCase(TIME_TYPE)) {
            if (!(value instanceof java.sql.Time)) {
                value = new java.sql.Time(value.getTime());
            }
        } else if (type.equalsIgnoreCase(DATE_TYPE)) {
            if (!(value instanceof java.sql.Date)) {
                value = new java.sql.Date(value.getTime());
            }
        } else {
            throw new JspException(
                    Resources.getMessage("SQL_DATE_PARAM_INVALID_TYPE", type));
        }
    }
1149525
@Override
    public ValidationResult validate(@Nullable final Object value) {
        if (value instanceof ObjectId) {
            return new ValidationResult.ValidationPassed();
        } else {
            return new ValidationResult.ValidationFailed(String.valueOf(value) + " is not a valid ObjectId!");
        }
    }
1069581
static public function notNull($value, $message = null, $propertyPath = null)
        {
            if ($value === null) {
                $message = $message ?: sprintf(
                    'Value "%s" is null, but non null value was expected.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::VALUE_NULL, $propertyPath);
            }
        }
890890
public DiscriminatorJdbcSubBuilder when(String value, Class<? extends T> type) {
        return when(value, (Type)type);
    }
60488
public function marshal($value)
    {
        if ($value === null || $value === '') {
            return null;
        }
        if (is_numeric($value)) {
            return (int)$value;
        }

        return null;
    }
500957
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		final String inputString = value.toString();
		
		for( final Enum<?> enumConstant : enumClass.getEnumConstants() ) {
			String constantName = enumConstant.name();
			if( ignoreCase ? constantName.equalsIgnoreCase(inputString) : constantName.equals(inputString) ) {
				return enumConstant;
			}
		}
		
		throw new SuperCsvCellProcessorException(String.format("'%s' could not be parsed as a enum of type %s", value,
			enumClass.getName()), context, this);
		
	}
1114136
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		int hash = value.hashCode();
		if( !requiredHashCodes.contains(hash) ) {
			throw new SuperCsvConstraintViolationException(String.format(
				"the hashcode of %d for value '%s' does not match any of the required hashcodes", hash, value),
				context, this);
		}
		
		return next.execute(value, context);
	}
300265
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		if( !(value instanceof Number) ) {
			throw new SuperCsvCellProcessorException(Number.class, value, context, this);
		}
		
		// create a new DecimalFormat if one is not supplied
		final DecimalFormat decimalFormatter;
		try {
			decimalFormatter = formatter != null ? formatter : new DecimalFormat(decimalFormat);
		}
		catch(IllegalArgumentException e) {
			throw new SuperCsvCellProcessorException(
				String.format("'%s' is not a valid decimal format", decimalFormat), context, this, e);
		}
		
		final String result = decimalFormatter.format(value);
		return next.execute(result, context);
	}
1112502
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		if( value.equals(token) ) {
			return returnValue;
		}
		
		return next.execute(value, context);
	}
461000
static function ensureValue($value)
    {
        if (!self::hasValue($value)) {
            throw new InvalidValueException(sprintf(
                'The value %s is not defined in enum class "%s", known values: %s',
                self::dumpValue($value),
                static::class,
                implode(', ', array_map([static::class, 'dumpValue'], self::getValues()))
            ));
        }
    }