Skip to content

Instantly share code, notes, and snippets.

View gunnarmorling's full-sized avatar
馃
Streaming data changes, one at a time.

Gunnar Morling gunnarmorling

馃
Streaming data changes, one at a time.
View GitHub Profile
/*
* Hibernate Validator, declare and validate application constraints
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package org.hibernate.validator.test.internal.engine.valueextraction;
import java.util.HashMap;
import java.util.Map;
{
"packages": [
{
"name": "org.hibernate.validator",
"reads": [
"org.hibernate.validator.cfg",
"org.hibernate.validator.internal.engine",
"org.hibernate.validator.metadata",
"org.hibernate.validator.spi.properties",
"org.hibernate.validator.spi.resourceloading",
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to module javassist
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
at [email protected]/javassist.util.proxy.SecurityActions.setAccessible(SecurityActions.java:103)
at [email protected]/javassist.util.proxy.FactoryHelper.toClass2(FactoryHelper.java:181)
at [email protected]/javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:164)
at [email protected]/javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory
[email protected] jar:file:hibernate-validator-6.0.4.Final.jar/!module-info.class
exports org.hibernate.validator
exports org.hibernate.validator.cfg
exports org.hibernate.validator.cfg.context
exports org.hibernate.validator.cfg.defs
exports org.hibernate.validator.cfg.defs.br
exports org.hibernate.validator.cfg.defs.pl
exports org.hibernate.validator.constraints
exports org.hibernate.validator.constraints.br
exports org.hibernate.validator.constraints.pl
<bean class="Customer" ignore-annotations="false">
<field name="listOfmails">
<!-- typeArgumentIndex optional if there is only one type argument or it's an array -->
<containerElementType typeArgumentIndex="0">
<constraint annotation="javax.validation.constraints.Email"/>
</containerElementType>
</field>
<field name="mapOfListOfmails">
<containerElementType typeArgumentIndex="1">
public class FishTank {
public List<Map<String, Set<@NotNull String>>> getTagsOfFishesOfTheWeek() { ... }
}
// Should we reject it?
public class DoubleExtractor implements ValueExtractor<Multimap<@ExtractedValue ?, @ExtractedValue ?>> {
@Override
public void extractValues(Multimap<?, ?> originalValue, ValueExtractor.ValueReceiver receiver) {
...
}
}
@ValueMapping( source = "BAR", target = "FOO" )
@ValueMapping( source = "<ANY>", target = "DEFAULT" )
@ValueMapping( source = "<ANY_UNMAPPED>", target = "BLUB" )
public class Try {
@NotNull(message = "field1", groups = BaseComponent.class)
public String field1;
@NotNull(message = "field2", groups = Component.class)
public String field2;
@NotNull(message = "field3", groups = OtherComponent.class)
public String field3 = "";
interface SingleValueExtractor<I, O> {
O extractValue(I input);
// only invoked if invalid; Property name enough as input?
Path.Node getNode(String property);
}