Skip to content

Commit

Permalink
HV-457: Adding names of Joda types to TypeNames
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Mar 28, 2012
1 parent c85cb92 commit 46f1e3d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Expand Up @@ -158,7 +158,7 @@ public ConstraintHelper(Elements elementUtils, Types typeUtils, AnnotationApiHel
);
registerAllowedTypesForBuiltInConstraintByNames(
Javax.Validation.Constraints.FUTURE,
CollectionHelper.<String>asSet( "org.joda.time.ReadablePartial", "org.joda.time.ReadableInstant" )
CollectionHelper.<String>asSet( Org.Joda.Time.READABLE_PARTIAL, Org.Joda.Time.READABLE_INSTANT )
);
registerAllowedTypesForBuiltInConstraint(
Javax.Validation.Constraints.MAX, CollectionHelper.<Class<?>>asSet( Number.class, String.class )
Expand All @@ -179,7 +179,7 @@ public ConstraintHelper(Elements elementUtils, Types typeUtils, AnnotationApiHel
);
registerAllowedTypesForBuiltInConstraintByNames(
Javax.Validation.Constraints.PAST,
CollectionHelper.<String>asSet( "org.joda.time.ReadablePartial", "org.joda.time.ReadableInstant" )
CollectionHelper.<String>asSet( Org.Joda.Time.READABLE_PARTIAL, Org.Joda.Time.READABLE_INSTANT )
);

registerAllowedTypesForBuiltInConstraint(
Expand Down
Expand Up @@ -88,6 +88,19 @@ public static class Group {
}
}
}

public static class Joda {

private static final String NAME = getName( Org.NAME, "joda" );

public static class Time {

private static final String NAME = getName( Joda.NAME, "time" );

public final static String READABLE_PARTIAL = getName( NAME, "ReadablePartial" );
public final static String READABLE_INSTANT = getName( NAME, "ReadableInstant" );
}
}
}

}

0 comments on commit 46f1e3d

Please sign in to comment.