public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone(), Features.construct(ann), ann.lenient().asBoolean()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone(), Features.construct(ann), ann.lenient().asBoolean()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone(), Features.construct(ann), ann.lenient().asBoolean()); }
private void read(ReflectAnnotatedElement annotations) { if (annotations == null) { return; } JsonFormat format = annotations.getAnnotation(JsonFormat.class); if (format == null) { return; } if (format.shape() == JsonFormat.Shape.STRING) { asString = true; } else { return; } pattern = format.pattern(); if (pattern.isEmpty()) { pattern = null; } locale = format.locale(); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone()); }
public Value(JsonFormat ann) { this(ann.pattern(), ann.shape(), ann.locale(), ann.timezone(), Features.construct(ann)); }
/** * Add the common property parameters to the code builder. * * @param paramBuilder the code builder * @param property the information about the property */ protected final void buildCommonPropertyParameters( CodeBlock.Builder paramBuilder, PropertyInfo property ) { if ( property.getFormat().isPresent() ) { JsonFormat format = property.getFormat().get(); if ( !Strings.isNullOrEmpty( format.pattern() ) ) { paramBuilder.add( "\n.setPattern($S)", format.pattern() ); } paramBuilder.add( "\n.setShape($T.$L)", Shape.class, format.shape().name() ); if ( !Strings.isNullOrEmpty( format.locale() ) && !JsonFormat.DEFAULT_LOCALE.equals( format.locale() ) ) { logger.log( Type.WARN, "JsonFormat.locale is not supported by default" ); paramBuilder.add( "\n.setLocale($S)", format.locale() ); } } if ( property.getIgnoredProperties().isPresent() ) { for ( String ignoredProperty : property.getIgnoredProperties().get() ) { paramBuilder.add( "\n.addIgnoredProperty($S)", ignoredProperty ); } } }