File |
Line |
org\jadira\bindings\core\provider\JodaConvertConverterProvider.java |
28 |
org\jadira\bindings\core\provider\StringConverterProvider.java |
28 |
public class JodaConvertConverterProvider extends AbstractAnnotationMatchingConverterProvider<ToString, FromString> implements ConverterProvider {
/**
* Subclasses can override this template method with their own matching strategy
* @param method The method to be determined
* @return True if match
*/
protected boolean isToMatch(Method method) {
return String.class.equals(method.getReturnType());
}
/**
* Subclasses can override this template method with their own matching strategy
* @param constructor The constructor to be determined
* @return True if match
*/
protected boolean isFromMatch(Constructor<?> constructor) {
return String.class.equals(constructor.getParameterTypes()[0]);
}
/**
* Subclasses can override this template method with their own matching strategy
* @param method The method to be determined
* @return True if match
*/
protected boolean isFromMatch(Method method) {
return String.class.equals(method.getParameterTypes()[0]);
}
} |
File |
Line |
org\jadira\bindings\core\general\binding\MethodConstructorBinding.java |
62 |
org\jadira\bindings\core\general\unmarshaller\ConstructorFromUnmarshaller.java |
75 |
return unmarshal.newInstance(str);
} catch (IllegalAccessException ex) {
throw new IllegalStateException("Constructor is not accessible");
} catch (InstantiationException ex) {
throw new IllegalStateException("Constructor is not valid");
} catch (InvocationTargetException ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
} |
File |
Line |
org\jadira\bindings\core\general\marshaller\MethodToMarshaller.java |
102 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
88 |
} catch (Throwable ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
}
/**
* {@inheritDoc}
*/
/* @Override */
public Class<S> getBoundClass() {
return boundClass;
}
/**
* {@inheritDoc}
*/
/* @Override */
public Class<T> getTargetClass() {
return targetClass;
}
} |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
279 |
org\jadira\bindings\core\binder\BasicBinder.java |
313 |
for (Provider nextProvider : nextConfig.getProviders()) {
try {
registerConverterProvider(nextProvider.getProviderClass().newInstance());
} catch (InstantiationException e) {
throw new IllegalStateException("Cannot instantiate binding provider class: " + nextProvider.getProviderClass().getName());
} catch (IllegalAccessException e) {
throw new IllegalStateException("Cannot access binding provider class: " + nextProvider.getProviderClass().getName());
}
} |
File |
Line |
org\jadira\bindings\core\general\unmarshaller\ConstructorFromUnmarshaller.java |
59 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
71 |
@SuppressWarnings("unchecked")
Class<T> myTarget = (Class<T>)unmarshal.getParameterTypes()[0];
this.targetClass = myTarget;
}
/**
* {@inheritDoc}
*/
/* @Override */
public S unmarshal(T object) {
if (object != null && !targetClass.isAssignableFrom(object.getClass())) {
throw new IllegalArgumentException("Supplied object was not instance of target class");
}
try {
return unmarshal.newInstance(object); |
File |
Line |
org\jadira\bindings\core\general\marshaller\MethodToMarshaller.java |
102 |
org\jadira\bindings\core\general\unmarshaller\ConstructorFromUnmarshaller.java |
80 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
88 |
} catch (Throwable ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
}
/**
* {@inheritDoc}
*/
/* @Override */
public Class<S> getBoundClass() {
return boundClass;
}
/**
* {@inheritDoc}
*/
/* @Override */
public Class<T> getTargetClass() {
return targetClass;
}
} |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
402 |
org\jadira\bindings\core\binder\BasicBinder.java |
420 |
org\jadira\bindings\core\binder\BasicBinder.java |
438 |
org\jadira\bindings\core\binder\BasicBinder.java |
456 |
registerBinding(binding.getBoundClass(), binding.getTargetClass(), binding, theBinding.getQualifier());
} catch (InstantiationException e) {
throw new IllegalStateException("Cannot instantiate binding class: " + theBinding.getBindingClass().getName());
} catch (IllegalAccessException e) {
throw new IllegalStateException("Cannot access binding class: " + theBinding.getBindingClass().getName());
}
} else if (FromUnmarshaller.class.isAssignableFrom(theBinding.getBindingClass())) { |
File |
Line |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
62 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
59 |
throw new IllegalStateException("unmarshal method must be parameterized by " + targetClass.getSimpleName());
}
if (!boundClass.isAssignableFrom(unmarshal.getReturnType())) {
throw new IllegalStateException("unmarshal method must return " + boundClass.getSimpleName());
}
try {
this.unmarshalHandle = LOOKUP.unreflect(unmarshal);
} catch (IllegalAccessException e) {
throw new IllegalStateException("Method is not accessible" + unmarshal);
} |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
104 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
153 |
Map<ConverterKey<?, ?>, Constructor<O>> matchedConstructors = new HashMap<ConverterKey<?, ?>, Constructor<O>>();
@SuppressWarnings("unchecked")
Class<F> fromAnnotation = (Class<F>) TypeHelper.getTypeArguments(
AbstractAnnotationMatchingConverterProvider.class,
this.getClass()).get(1);
Class<?> loopCls = cls;
while (loopCls != Object.class) { |
File |
Line |
org\jadira\bindings\core\general\binding\CompositeBinding.java |
38 |
org\jadira\bindings\core\general\binding\InverseCompositeBinding.java |
53 |
public CompositeBinding(ToMarshaller<S, T> marshal, FromUnmarshaller<S, T> unmarshal) {
if (unmarshal == null) {
throw new IllegalStateException("Unmarshaller may not be null");
}
if (marshal == null) {
throw new IllegalStateException("Marshaller may not be null");
}
this.unmarshal = unmarshal;
this.marshal = marshal;
}
/**
* {@inheritDoc}
*/
/* @Override */
public T marshal(S object) {
return marshal.marshal(object); |
File |
Line |
org\jadira\bindings\core\general\binding\CompositeBinding.java |
56 |
org\jadira\bindings\core\general\binding\FromBinding.java |
48 |
return marshal.marshal(object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public S unmarshal(T inputString) {
return unmarshal.unmarshal(inputString);
}
/**
* {@inheritDoc}
*/
/* @Override */
public Class<S> getBoundClass() {
return unmarshal.getBoundClass();
}
/**
* {@inheritDoc}
*/
/* @Override */
public Class<T> getTargetClass() {
return unmarshal.getTargetClass();
}
} |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1110 |
org\jadira\bindings\core\binder\BasicBinder.java |
1124 |
Map<ConverterKey<?,?>, Method> nextMethods = nextConverter.matchToMethods(target);
for(ConverterKey<?,?> currentKey : nextMethods.keySet()) {
if (previouslySeenKeys.contains(currentKey)) {
throw new IllegalStateException("Method is resolved by two converters: " + currentKey.toString());
}
previouslySeenKeys.add(currentKey);
} |
File |
Line |
org\jadira\bindings\core\general\binding\MethodConstructorBinding.java |
44 |
org\jadira\bindings\core\general\unmarshaller\ConstructorFromUnmarshaller.java |
44 |
super(unmarshal.getDeclaringClass(), targetClass, marshal);
if (getBoundClass().isInterface()
|| Modifier.isAbstract(getBoundClass().getModifiers())
|| getBoundClass().isLocalClass()
|| getBoundClass().isMemberClass()) {
throw new IllegalStateException("unmarshal constructor must have an instantiable target class");
} |
File |
Line |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
82 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
87 |
return getBoundClass().cast(unmarshalHandle.invoke(string));
} catch (Throwable ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
} |
File |
Line |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
83 |
org\jadira\bindings\core\general\marshaller\MethodToMarshaller.java |
102 |
} catch (Throwable ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
} |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
83 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
186 |
private boolean signatureIndicatesToMethodCandidate(Method method) {
if (!Modifier.isPublic(method.getModifiers())) {
return false;
}
if (method.getReturnType().equals(Void.TYPE)) {
return false;
}
if (!isToMatch(method)) { |
File |
Line |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
54 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
55 |
if (unmarshal.getParameterTypes().length != 1) {
throw new IllegalStateException("unmarshal method must define a single parameter");
}
if (!Modifier.isStatic(unmarshal.getModifiers())) {
throw new IllegalStateException("unmarshal method must be defined as static");
}
if (unmarshal.getParameterTypes()[0] != targetClass) { |
File |
Line |
org\jadira\bindings\core\general\binding\MethodConstructorBinding.java |
67 |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
83 |
} catch (InvocationTargetException ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
}
} |
File |
Line |
org\jadira\bindings\core\general\binding\MethodConstructorBinding.java |
67 |
org\jadira\bindings\core\general\marshaller\MethodToMarshaller.java |
102 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
88 |
} catch (InvocationTargetException ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
} |
File |
Line |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
83 |
org\jadira\bindings\core\general\unmarshaller\ConstructorFromUnmarshaller.java |
80 |
} catch (Throwable ex) {
if (ex.getCause() instanceof RuntimeException) {
throw (RuntimeException) ex.getCause();
}
throw new BindingException(ex.getMessage(), ex.getCause());
}
} |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
40 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
151 |
public <I,O> Map<ConverterKey<?, ?>, Method> matchToMethods(Class<?> cls) {
Map<ConverterKey<?, ?>, Method> matchedMethods = new HashMap<ConverterKey<?, ?>, Method>();
@SuppressWarnings("unchecked")
Class<T> toAnnotation = (Class<T>) TypeHelper.getTypeArguments( |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
878 |
org\jadira\bindings\core\cdi\BinderExtension.java |
169 |
return findUnmarshaller(new ConverterKey<S,T>(source, target, DefaultBinding.class));
}
/**
* Resolve a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
*
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param source The source (owning) class
* @param target The target (foreign) class
* @param qualifier The qualifier for which the binding must be registered
*/
public <S, T> Binding<S, T> findBinding(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
return findBinding(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier)); |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
36 |
org\jadira\bindings\core\binder\BasicBinder.java |
1179 |
return binder.convertTo(String.class, output, object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <T> T convertFromString(Class<T> output, String object, Class<? extends Annotation> qualifier) {
return binder.convertTo(String.class, output, object, qualifier); |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
68 |
org\jadira\bindings\core\binder\BasicBinder.java |
1197 |
return binder.convertTo(input, String.class, object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S> String convertToString(Class<S> input, Object object,
Class<? extends Annotation> qualifier) {
return binder.convertTo(input, String.class, object, qualifier); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
944 |
org\jadira\bindings\core\cdi\BinderExtension.java |
186 |
}
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param qualifier The qualifier for which the marshaller must be registered
*/
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
return findMarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier)); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
975 |
org\jadira\bindings\core\cdi\BinderExtension.java |
202 |
}
/**
* Resolve a Converter with the given input and output classes. Instances of the input class can be converted into
* instances of the output class
* @param source The source class
* @param target The target class
* @param qualifier The qualifier for which the marshaller must be registered
*/
public <S, T> Converter<S, T> findConverter(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
return findConverter(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier)); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1008 |
org\jadira\bindings\core\cdi\BinderExtension.java |
218 |
}
/**
* Resolve an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param qualifier The qualifier for which the unmarshaller must be registered
*/
public <S, T> FromUnmarshaller<S, T> findUnmarshaller(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
return findUnmarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier)); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
75 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
122 |
<S, T> void registerConverter(ConverterKey<S,T> key, Converter<S, T> converter);
/**
* Register a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
*
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param sourceClass The source (owning) class
* @param targetClass The target (foreign) class
* @param converter The binding to be registered
* @param <S> Source type
* @param <T> Target type
*/
<S, T> void registerBinding(final Class<S> sourceClass, Class<T> targetClass, Binding<S, T> converter); |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
47 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
158 |
this.getClass()).get(0);
Class<?> loopCls = cls;
while (loopCls != Object.class) {
Method[] methods = loopCls.getDeclaredMethods();
for (Method method : methods) {
if (signatureIndicatesToMethodCandidate(method)) { |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
249 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
257 |
for (Annotation next : bindingAnnotation.annotationType().getAnnotations()) {
Class<? extends Annotation> nextType = next.annotationType();
if (nextType.getAnnotation(BindingScope.class) != null) {
result.add(nextType);
}
} |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1151 |
org\jadira\bindings\core\binder\BasicBinder.java |
1155 |
ConstructorFromUnmarshaller<I,O> fromUnmarshaller = new ConstructorFromUnmarshaller<I,O>(con);
registerBinding(key.getInputClass(), key.getOutputClass(), new CompositeBinding<I,O>(toMarshaller, fromUnmarshaller), key.getQualifierAnnotation());
} else if (fromMethod != null) { |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
149 |
org\jadira\bindings\core\cdi\BinderExtension.java |
296 |
<S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter, Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
161 |
org\jadira\bindings\core\cdi\BinderExtension.java |
312 |
<S, T> void registerMarshaller(Class<S> sourceClass, Class<T> targetClass, ToMarshaller<S, T> converter, Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
546 |
org\jadira\bindings\core\binder\BasicBinder.java |
558 |
org\jadira\bindings\core\binder\BasicBinder.java |
570 |
registerBinding(new ConverterKey<S,T>(source, target, scope == null ? DefaultBinding.class : scope), converter);
}
/**
* Register an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param converter The FromUnmarshaller to be registered
*/
public final <S, T> void registerUnmarshaller(Class<S> source, Class<T> target, FromUnmarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
597 |
org\jadira\bindings\core\binder\BasicBinder.java |
624 |
org\jadira\bindings\core\binder\BasicBinder.java |
646 |
registerBinding(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier), converter);
}
/**
* Register a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
*
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param key Converter Key to use
* @param converter The binding to be registered
*/
public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
122 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
169 |
List<Class<? extends Annotation>> qualifiers = determineQualifiers(fromConstructorAnnotation, constructor.getAnnotations());
for (Class<? extends Annotation> nextQualifier : qualifiers) {
@SuppressWarnings("unchecked")
Class<I> paramType = (Class<I>)constructor.getParameterTypes()[0]; |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1064 |
org\jadira\bindings\core\spring\BindingConverter.java |
84 |
for (Annotation next : implementation.getAnnotations()) {
Class<? extends Annotation> nextType = next.annotationType();
if (nextType.getAnnotation(BindingScope.class) != null) {
return nextType;
}
}
return null; |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1064 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
249 |
for (Annotation next : implementation.getAnnotations()) {
Class<? extends Annotation> nextType = next.annotationType();
if (nextType.getAnnotation(BindingScope.class) != null) { |
File |
Line |
org\jadira\bindings\core\cdi\BinderExtension.java |
249 |
org\jadira\bindings\core\cdi\BinderExtension.java |
289 |
BINDING.registerBinding(sourceClass, targetClass, converter);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\cdi\BinderExtension.java |
257 |
org\jadira\bindings\core\cdi\BinderExtension.java |
305 |
BINDING.registerUnmarshaller(sourceClass, targetClass, converter);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S, T> void registerMarshaller(Class<S> sourceClass, Class<T> targetClass, ToMarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\cdi\BinderExtension.java |
265 |
org\jadira\bindings\core\cdi\BinderExtension.java |
321 |
BINDING.registerMarshaller(sourceClass, targetClass, converter);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S, T> void registerConverter(Class<S> sourceClass, Class<T> targetClass, Converter<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\loader\BindingConfigurationEntry.java |
86 |
org\jadira\bindings\core\loader\BindingConfigurationEntry.java |
108 |
Method fromMethod) {
this.sourceClass = sourceClass;
this.targetClass = targetClass;
this.qualifier = qualifier == null ? DefaultBinding.class : qualifier;
this.toMethod = toMethod;
this.fromMethod = fromMethod; |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
36 |
org\jadira\bindings\core\binder\BasicBinder.java |
1179 |
org\jadira\bindings\core\cdi\BinderExtension.java |
361 |
return binder.convertTo(String.class, output, object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <T> T convertFromString(Class<T> output, String object, Class<? extends Annotation> qualifier) {
return binder.convertTo(String.class, output, object, qualifier); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
525 |
org\jadira\bindings\core\binder\BasicBinder.java |
582 |
return (I) extendedBinders.get(cls);
}
/******************
* *
* Registration *
* *
******************/
/**
* Register a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
*
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param source The source (owning) class
* @param target The target (foreign) class
* @param converter The binding to be registered
*/
public final <S, T> void registerBinding(Class<S> source, Class<T> target, Binding<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
546 |
org\jadira\bindings\core\binder\BasicBinder.java |
611 |
registerBinding(new ConverterKey<S,T>(source, target, scope == null ? DefaultBinding.class : scope), converter);
}
/**
* Register an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param converter The FromUnmarshaller to be registered
*/
public final <S, T> void registerUnmarshaller(Class<S> source, Class<T> target, FromUnmarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
558 |
org\jadira\bindings\core\binder\BasicBinder.java |
634 |
registerUnmarshaller(new ConverterKey<S,T>(source, target, scope == null ? DefaultBinding.class : scope), converter);
}
/**
* Register a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param converter The ToMarshaller to be registered
*/
public final <S, T> void registerMarshaller(Class<S> source, Class<T> target, ToMarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
570 |
org\jadira\bindings\core\binder\BasicBinder.java |
656 |
registerMarshaller(new ConverterKey<S,T>(source, target, scope == null ? DefaultBinding.class : scope), converter);
}
/**
* Register a Converter with the given input and output classes. Instances of the input class can be converted into
* instances of the output class
* @param input The input class
* @param output The output class
* @param converter The Converter to be registered
*/
public final <S, T> void registerConverter(Class<S> input, Class<T> output, Converter<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
805 |
org\jadira\bindings\core\binder\ConversionBinder.java |
68 |
public <S, T> T convertTo(Class<S> input, Class<T> output, Object object, Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
954 |
org\jadira\bindings\core\binder\BasicBinder.java |
985 |
org\jadira\bindings\core\binder\BasicBinder.java |
1018 |
return findMarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier));
}
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param key The key to look up
*/
public <S, T> ToMarshaller<S, T> findMarshaller(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
68 |
org\jadira\bindings\core\binder\BasicBinder.java |
1197 |
org\jadira\bindings\core\cdi\BinderExtension.java |
395 |
return binder.convertTo(input, String.class, object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S> String convertToString(Class<S> input, Object object,
Class<? extends Annotation> qualifier) {
return binder.convertTo(input, String.class, object, qualifier); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
829 |
org\jadira\bindings\core\cdi\BinderExtension.java |
137 |
return conv.convert(myObject);
}
/*************************
* *
* Conversion Resolution *
* *
*************************/
/**
* Resolve a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
*
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param source The source (owning) class
* @param target The target (foreign) class
*/
public <S, T> Binding<S, T> findBinding(Class<S> source, Class<T> target) {
return findBinding(new ConverterKey<S,T>(source, target, DefaultBinding.class)); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
848 |
org\jadira\bindings\core\cdi\BinderExtension.java |
145 |
return findBinding(new ConverterKey<S,T>(source, target, DefaultBinding.class));
}
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
*/
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target) {
return findMarshaller(new ConverterKey<S,T>(source, target, DefaultBinding.class)); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
868 |
org\jadira\bindings\core\cdi\BinderExtension.java |
161 |
return findConverter(new ConverterKey<S,T>(input, output, DefaultBinding.class));
}
/**
* Resolve an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
*/
public <S, T> FromUnmarshaller<S, T> findUnmarshaller(Class<S> source, Class<T> target) {
return findUnmarshaller(new ConverterKey<S,T>(source, target, DefaultBinding.class)); |
File |
Line |
org\jadira\bindings\core\cdi\BinderExtension.java |
241 |
org\jadira\bindings\core\cdi\BinderExtension.java |
273 |
BINDING.registerConfiguration(nextLocation);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S, T> void registerBinding(Class<S> sourceClass, Class<T> targetClass, Binding<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\general\binding\CompositeBinding.java |
48 |
org\jadira\bindings\core\general\binding\ToBinding.java |
39 |
this.marshal = marshal;
}
/**
* {@inheritDoc}
*/
/* @Override */
public T marshal(S object) {
return marshal.marshal(object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public S unmarshal(T inputString) { |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
60 |
org\jadira\bindings\core\binder\BasicBinder.java |
1193 |
return binder.convertTo(String.class, object, qualifier);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S> String convertToString(Class<S> input, Object object) {
return binder.convertTo(input, String.class, object); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
731 |
org\jadira\bindings\core\cdi\BinderExtension.java |
104 |
return convertTo(output, object, DefaultBinding.class);
}
/**
* Convert an object to the given target class
* This method infers the source type for the conversion from the runtime type of object.
* @param output The target class to convert the object to
* @param object The object to be converted
* @param qualifier The qualifier for which the binding must be registered
*/
public <S, T> T convertTo(Class<T> output, Object object, Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
926 |
org\jadira\bindings\core\binder\BasicBinder.java |
933 |
if (theBinding.getBoundClass().equals(key.getInputClass())) {
@SuppressWarnings("unchecked")
final Binding<S, T>myBinding = (Binding<S, T>)theBinding; |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1064 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
257 |
for (Annotation next : implementation.getAnnotations()) {
Class<? extends Annotation> nextType = next.annotationType();
if (nextType.getAnnotation(BindingScope.class) != null) { |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
111 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
161 |
<S, T> void registerMarshaller(Class<S> sourceClass, Class<T> targetClass, ToMarshaller<S, T> converter);
/**
* Register a Converter with the given input and output classes. Instances of the input class can be converted into
* instances of the output class
* @param sourceClass The source (input) class
* @param targetClass The target (output) class
* @param converter The Converter to be registered
* @param <S> Source type
* @param <T> Target type
*/
<S, T> void registerConverter(final Class<S> sourceClass, Class<T> targetClass, Converter<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\SearchableBinder.java |
130 |
org\jadira\bindings\core\binder\SearchableBinder.java |
142 |
org\jadira\bindings\core\binder\SearchableBinder.java |
154 |
<S, T> Binding<S, T> findBinding(final Class<S> source, final Class<T> target, final Class<? extends Annotation> qualifier);
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param qualifier The qualifier for which the marshaller must be registered
* @param <S> The Source type
* @param <T> The Target type
* @return The found Marshaller
*/
<S, T> ToMarshaller<S, T> findMarshaller(final Class<S> source, final Class<T> target, final Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\jdk\CalendarStringBinding.java |
30 |
org\jadira\bindings\core\jdk\DateStringBinding.java |
29 |
public class CalendarStringBinding extends AbstractStringBinding<Calendar> implements Binding<Calendar, String> {
private static final ThreadLocal<SimpleDateFormat> DATE_FORMAT = new ThreadLocal<SimpleDateFormat>() {
@Override
public SimpleDateFormat initialValue() { |
File |
Line |
org\jadira\bindings\core\loader\BindingConfigurationEntry.java |
73 |
org\jadira\bindings\core\loader\BindingConfigurationEntry.java |
95 |
this.fromConstructor = null;
}
/**
* Create a new entry for the given options
* @param sourceClass The source class to be bound
* @param targetClass The foreign side of the relationship
* @param qualifier The qualifier
* @param toMethod The to method to be bound
* @param fromMethod The from method to be bound
*/
public BindingConfigurationEntry(Class<?> sourceClass, Class<?> targetClass,
Class<? extends Annotation> qualifier, Method toMethod, |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
249 |
org\jadira\bindings\core\spring\BindingConverter.java |
84 |
for (Annotation next : bindingAnnotation.annotationType().getAnnotations()) {
Class<? extends Annotation> nextType = next.annotationType();
if (nextType.getAnnotation(BindingScope.class) != null) { |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
89 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
137 |
<S, T> void registerBinding(final Class<S> sourceClass, Class<T> targetClass, Binding<S, T> converter);
/**
* Register an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param sourceClass The source (input) class
* @param targetClass The target (output) class
* @param converter The FromUnmarshaller to be registered
* @param <S> Source type
* @param <T> Target type
*/
<S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
100 |
org\jadira\bindings\core\cdi\BinderExtension.java |
256 |
<S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
100 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
149 |
<S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter);
/**
* Register a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param sourceClass The source (input) class
* @param targetClass The target (output) class
* @param converter The ToMarshaller to be registered
* @param <S> Source type
* @param <T> Target type
*/
<S, T> void registerMarshaller(Class<S> sourceClass, Class<T> targetClass, ToMarshaller<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
111 |
org\jadira\bindings\core\cdi\BinderExtension.java |
264 |
<S, T> void registerMarshaller(Class<S> sourceClass, Class<T> targetClass, ToMarshaller<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
137 |
org\jadira\bindings\core\cdi\BinderExtension.java |
280 |
<S, T> void registerBinding(final Class<S> sourceClass, Class<T> targetClass, Binding<S, T> converter, Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
173 |
org\jadira\bindings\core\cdi\BinderExtension.java |
328 |
<S, T> void registerConverter(final Class<S> sourceClass, Class<T> targetClass, Converter<S, T> converter, Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
609 |
org\jadira\bindings\core\binder\BasicBinder.java |
633 |
public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) {
registerConverter(key.invert(), new FromUnmarshallerConverter<S,T>(converter)); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
829 |
org\jadira\bindings\core\binder\BasicBinder.java |
878 |
org\jadira\bindings\core\cdi\BinderExtension.java |
137 |
org\jadira\bindings\core\cdi\BinderExtension.java |
169 |
return conv.convert(myObject);
}
/*************************
* *
* Conversion Resolution *
* *
*************************/
/**
* Resolve a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
*
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param source The source (owning) class
* @param target The target (foreign) class
*/
public <S, T> Binding<S, T> findBinding(Class<S> source, Class<T> target) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
848 |
org\jadira\bindings\core\cdi\BinderExtension.java |
145 |
org\jadira\bindings\core\cdi\BinderExtension.java |
185 |
return findBinding(new ConverterKey<S,T>(source, target, DefaultBinding.class));
}
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
*/
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
868 |
org\jadira\bindings\core\cdi\BinderExtension.java |
161 |
org\jadira\bindings\core\cdi\BinderExtension.java |
217 |
return findConverter(new ConverterKey<S,T>(input, output, DefaultBinding.class));
}
/**
* Resolve an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
*/
public <S, T> FromUnmarshaller<S, T> findUnmarshaller(Class<S> source, Class<T> target) { |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
100 |
org\jadira\bindings\core\cdi\BinderExtension.java |
296 |
<S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
111 |
org\jadira\bindings\core\cdi\BinderExtension.java |
312 |
<S, T> void registerMarshaller(Class<S> sourceClass, Class<T> targetClass, ToMarshaller<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
149 |
org\jadira\bindings\core\cdi\BinderExtension.java |
256 |
<S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter, Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
161 |
org\jadira\bindings\core\cdi\BinderExtension.java |
264 |
<S, T> void registerMarshaller(Class<S> sourceClass, Class<T> targetClass, ToMarshaller<S, T> converter, Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\binder\SearchableBinder.java |
68 |
org\jadira\bindings\core\binder\SearchableBinder.java |
115 |
<S, T> FromUnmarshaller<S, T> findUnmarshaller(ConverterKey<S,T> key);
/**
* Resolve a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
* <br>
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param source The source (owning) class
* @param target The target (foreign) class
* @param <S> The Source type
* @param <T> The Target type
* @return The found Binding
*/
<S, T> Binding<S, T> findBinding(final Class<S> source, final Class<T> target); |
File |
Line |
org\jadira\bindings\core\binder\SearchableBinder.java |
82 |
org\jadira\bindings\core\binder\SearchableBinder.java |
130 |
<S, T> Binding<S, T> findBinding(final Class<S> source, final Class<T> target);
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param <S> The Source type
* @param <T> The Target type
* @return The found Marshaller
*/
<S, T> ToMarshaller<S, T> findMarshaller(final Class<S> source, final Class<T> target); |
File |
Line |
org\jadira\bindings\core\binder\SearchableBinder.java |
93 |
org\jadira\bindings\core\binder\SearchableBinder.java |
142 |
<S, T> ToMarshaller<S, T> findMarshaller(final Class<S> source, final Class<T> target);
/**
* Resolve a Converter with the given input and output classes. Instances of the input class can be converted into
* instances of the output class
* @param source The input class
* @param target The output class
* @param <S> The Source type
* @param <T> The Target type
* @return The found Converter
*/
<S, T> Converter<S, T> findConverter(final Class<S> source, final Class<T> target); |
File |
Line |
org\jadira\bindings\core\binder\SearchableBinder.java |
104 |
org\jadira\bindings\core\binder\SearchableBinder.java |
154 |
<S, T> Converter<S, T> findConverter(final Class<S> source, final Class<T> target);
/**
* Resolve an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param <S> The Source type
* @param <T> The Target type
* @return The found Unmarshaller
*/
<S, T> FromUnmarshaller<S, T> findUnmarshaller(final Class<S> source, final Class<T> target); |
File |
Line |
org\jadira\bindings\core\cdi\BinderExtension.java |
153 |
org\jadira\bindings\core\cdi\BinderExtension.java |
201 |
return BINDING.findMarshaller(source, target);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S, T> Converter<S, T> findConverter(Class<S> source, Class<T> target) { |
File |
Line |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
205 |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
231 |
Class<?> providerClass = lookupClass(element.getAttribute("class"));
if (providerClass == null) {
throw new IllegalStateException("Referenced class {" + element.getAttribute("class")
+ "} could not be found");
}
if (!ConverterProvider.class.isAssignableFrom(providerClass)) { |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
57 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
169 |
List<Class<? extends Annotation>> qualifiers = determineQualifiers(toMethodAnnotation, method.getAnnotations());
for (Class<? extends Annotation> nextQualifier : qualifiers) {
@SuppressWarnings("unchecked")
Class<O> returnType = (Class<O>)method.getReturnType(); |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
102 |
org\jadira\bindings\core\spi\ConverterProvider.java |
45 |
public <I,O> Map<ConverterKey<?,?>, Constructor<O>> matchFromConstructors(Class<O> cls) { |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
52 |
org\jadira\bindings\core\binder\BasicBinder.java |
1188 |
return binder.convertTo(String.class, object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public String convertToString(Object object, Class<? extends Annotation> qualifier) {
return binder.convertTo(String.class, object, qualifier); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
849 |
org\jadira\bindings\core\binder\BasicBinder.java |
944 |
org\jadira\bindings\core\cdi\BinderExtension.java |
146 |
}
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
*/
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
869 |
org\jadira\bindings\core\binder\BasicBinder.java |
1008 |
org\jadira\bindings\core\cdi\BinderExtension.java |
162 |
}
/**
* Resolve an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
*/
public <S, T> FromUnmarshaller<S, T> findUnmarshaller(Class<S> source, Class<T> target) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
975 |
org\jadira\bindings\core\cdi\BinderExtension.java |
154 |
}
/**
* Resolve a Converter with the given input and output classes. Instances of the input class can be converted into
* instances of the output class
* @param source The source class
* @param target The target class
* @param qualifier The qualifier for which the marshaller must be registered
*/
public <S, T> Converter<S, T> findConverter(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
609 |
org\jadira\bindings\core\cdi\BinderExtension.java |
288 |
public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
633 |
org\jadira\bindings\core\cdi\BinderExtension.java |
304 |
public final <S, T> void registerUnmarshaller(ConverterKey<S,T> key, FromUnmarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
655 |
org\jadira\bindings\core\cdi\BinderExtension.java |
320 |
public final <S, T> void registerMarshaller(ConverterKey<S,T> key, ToMarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
677 |
org\jadira\bindings\core\cdi\BinderExtension.java |
336 |
public final <S, T> void registerConverter(ConverterKey<S,T> key, Converter<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
741 |
org\jadira\bindings\core\binder\ConversionBinder.java |
43 |
org\jadira\bindings\core\cdi\BinderExtension.java |
111 |
public <S, T> T convertTo(Class<T> output, Object object, Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
848 |
org\jadira\bindings\core\binder\BasicBinder.java |
858 |
org\jadira\bindings\core\binder\BasicBinder.java |
878 |
return findBinding(new ConverterKey<S,T>(source, target, DefaultBinding.class));
}
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
*/
public <S, T> ToMarshaller<S, T> findMarshaller(Class<S> source, Class<T> target) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
892 |
org\jadira\bindings\core\binder\BasicBinder.java |
954 |
org\jadira\bindings\core\binder\BasicBinder.java |
985 |
org\jadira\bindings\core\binder\BasicBinder.java |
1018 |
return findBinding(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier));
} |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
954 |
org\jadira\bindings\core\cdi\BinderExtension.java |
193 |
return findMarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier));
}
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param key The key to look up
*/
public <S, T> ToMarshaller<S, T> findMarshaller(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
985 |
org\jadira\bindings\core\cdi\BinderExtension.java |
209 |
return findConverter(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier));
}
/**
* Resolve a Converter with the given input and output classes. Instances of the input class can be converted into
* instances of the output class
* @param key The key to look up
*/
public <S, T> Converter<S, T> findConverter(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1018 |
org\jadira\bindings\core\cdi\BinderExtension.java |
225 |
return findUnmarshaller(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier));
}
/**
* Resolve an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param key The key to look up
*/
public <S, T> FromUnmarshaller<S, T> findUnmarshaller(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1107 |
org\jadira\bindings\core\binder\BasicBinder.java |
1121 |
private void matchTo(Class<?> target, Set<ConverterKey<?,?>> previouslySeenKeys, Map<ConverterKey<?,?>, Method> toMethods) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1107 |
org\jadira\bindings\core\binder\BasicBinder.java |
1121 |
private void matchTo(Class<?> target, Set<ConverterKey<?,?>> previouslySeenKeys, Map<ConverterKey<?,?>, Method> toMethods) {
for (ConverterProvider nextConverter : converterProviders) {
Map<ConverterKey<?,?>, Method> nextMethods = nextConverter.matchToMethods(target); |
File |
Line |
org\jadira\bindings\core\binder\ConversionBinder.java |
43 |
org\jadira\bindings\core\binder\ConversionBinder.java |
68 |
<S,T> T convertTo(Class<T> output, Object object, Class<? extends Annotation> qualifier);
// TODO Add find methods equating to convertTo
/**
* Convert an object which is an instance of source class to the given target class
* @param input The class of the object to be converted
* @param output The target class to convert the object to
* @param object The object to be converted
* @param <S> The Source type
* @param <T> The Target type
* @return The result of the conversion
*/
<S, T> T convertTo(Class<S> input, Class<T> output, Object object); |
File |
Line |
org\jadira\bindings\core\cdi\BinderExtension.java |
113 |
org\jadira\bindings\core\cdi\BinderExtension.java |
121 |
return BINDING.convertTo(output, object, qualifier);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S, T> T convertTo(Class<S> sourceClass, Class<T> target, Object object) { |
File |
Line |
org\jadira\bindings\core\cdi\BinderExtension.java |
176 |
org\jadira\bindings\core\cdi\BinderExtension.java |
192 |
org\jadira\bindings\core\cdi\BinderExtension.java |
208 |
org\jadira\bindings\core\cdi\BinderExtension.java |
224 |
public <S, T> Binding<S, T> findBinding(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
return BINDING.findBinding(source, target, qualifier); |
File |
Line |
org\jadira\bindings\core\general\marshaller\ConverterToMarshaller.java |
52 |
org\jadira\bindings\core\general\unmarshaller\ConverterFromUnmarshaller.java |
34 |
public ConverterToMarshaller(Converter<S,T> converter) {
if (converter == null) {
throw new IllegalStateException("converter must not be null");
}
this.converter = converter;
}
/**
* {@inheritDoc}
*/
/* @Override */
public T marshal(S object) { |
File |
Line |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
331 |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
344 |
fromMethod = bindingClass.getMethod(fromMethodName, new Class[] { String.class });
} catch (SecurityException e) {
} catch (NoSuchMethodException e) {
} |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
57 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
122 |
List<Class<? extends Annotation>> qualifiers = determineQualifiers(toMethodAnnotation, method.getAnnotations());
for (Class<? extends Annotation> nextQualifier : qualifiers) {
@SuppressWarnings("unchecked")
Class<O> returnType = (Class<O>)method.getReturnType(); |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
94 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
194 |
if ((!(Modifier.isStatic(method.getModifiers()) && method.getParameterTypes().length == 1)) |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
237 |
org\jadira\bindings\core\binder\BasicBinder.java |
251 |
builtInBindingsUrl = new URL(classPrefix + "META-INF/bindings.xml");
} catch (IOException e) {
throw new IllegalStateException("Error registering bindings: " + e.getMessage(), e);
} |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
544 |
org\jadira\bindings\core\binder\BasicBinder.java |
556 |
org\jadira\bindings\core\binder\BasicBinder.java |
568 |
org\jadira\bindings\core\binder\BasicBinder.java |
580 |
public final <S, T> void registerBinding(Class<S> source, Class<T> target, Binding<S, T> converter) {
Class<? extends Annotation> scope = matchImplementationToScope(converter.getClass()); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
609 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
45 |
org\jadira\bindings\core\cdi\BinderExtension.java |
288 |
public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
611 |
org\jadira\bindings\core\binder\BasicBinder.java |
656 |
registerConverter(key, new ToMarshallerConverter<S,T>(converter));
}
/**
* Register an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param converter The FromUnmarshaller to be registered
* @param qualifier The qualifier for which the unmarshaller must be registered
*/
public final <S, T> void registerUnmarshaller(Class<S> source, Class<T> target, FromUnmarshaller<S, T> converter, Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
633 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
55 |
org\jadira\bindings\core\cdi\BinderExtension.java |
304 |
public final <S, T> void registerUnmarshaller(ConverterKey<S,T> key, FromUnmarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
655 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
65 |
org\jadira\bindings\core\cdi\BinderExtension.java |
320 |
public final <S, T> void registerMarshaller(ConverterKey<S,T> key, ToMarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
677 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
75 |
org\jadira\bindings\core\cdi\BinderExtension.java |
336 |
public final <S, T> void registerConverter(ConverterKey<S,T> key, Converter<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
786 |
org\jadira\bindings\core\binder\BasicBinder.java |
796 |
}
/**
* Convert an object which is an instance of source class to the given target class
* @param input The class of the object to be converted
* @param output The target class to convert the object to
* @param object The object to be converted
*/
public <S, T> T convertTo(Class<S> input, Class<T> output, Object object) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1086 |
org\jadira\bindings\core\binder\BasicBinder.java |
1087 |
Map<ConverterKey<?,?>, Method> toMethods = new HashMap<ConverterKey<?,?>, Method>();
Map<ConverterKey<?,?>, Method> fromMethods = new HashMap<ConverterKey<?,?>, Method>(); |
File |
Line |
org\jadira\bindings\core\binder\SearchableBinder.java |
130 |
org\jadira\bindings\core\binder\SearchableBinder.java |
142 |
org\jadira\bindings\core\binder\SearchableBinder.java |
154 |
org\jadira\bindings\core\binder\SearchableBinder.java |
166 |
<S, T> Binding<S, T> findBinding(final Class<S> source, final Class<T> target, final Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
40 |
org\jadira\bindings\core\spi\ConverterProvider.java |
36 |
public <I,O> Map<ConverterKey<?, ?>, Method> matchToMethods(Class<?> cls) { |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
96 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
145 |
(!(!Modifier.isStatic(method.getModifiers()) && method.getParameterTypes().length == 0))) {
return false;
}
return true;
}
public <I,O> Map<ConverterKey<?,?>, Constructor<O>> matchFromConstructors(Class<O> cls) { |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
151 |
org\jadira\bindings\core\spi\ConverterProvider.java |
54 |
public <I,O> Map<ConverterKey<?,?>, Method> matchFromMethods(Class<?> cls) { |
File |
Line |
org\jadira\bindings\core\annotation\Convert.java |
40 |
org\jadira\bindings\core\annotation\From.java |
35 |
org\jadira\bindings\core\annotation\typesafe\FromString.java |
35 |
@Target({ ElementType.METHOD, ElementType.CONSTRUCTOR })
@Retention(RetentionPolicy.RUNTIME)
public @interface Convert { |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
43 |
org\jadira\bindings\core\binder\BasicBinder.java |
1182 |
org\jadira\bindings\core\binder\StringBinder.java |
39 |
org\jadira\bindings\core\cdi\BinderExtension.java |
368 |
public <T> T convertFromString(Class<T> output, String object, Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
60 |
org\jadira\bindings\core\binder\BasicBinder.java |
1193 |
org\jadira\bindings\core\cdi\BinderExtension.java |
387 |
return binder.convertTo(String.class, object, qualifier);
}
/**
* {@inheritDoc}
*/
/* @Override */
public <S> String convertToString(Class<S> input, Object object) {
return binder.convertTo(input, String.class, object); |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
75 |
org\jadira\bindings\core\binder\BasicBinder.java |
1200 |
org\jadira\bindings\core\binder\StringBinder.java |
75 |
org\jadira\bindings\core\cdi\BinderExtension.java |
402 |
public <S> String convertToString(Class<S> input, Object object,
Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
546 |
org\jadira\bindings\core\binder\BasicBinder.java |
558 |
org\jadira\bindings\core\binder\BasicBinder.java |
570 |
org\jadira\bindings\core\binder\BasicBinder.java |
582 |
registerBinding(new ConverterKey<S,T>(source, target, scope == null ? DefaultBinding.class : scope), converter);
}
/**
* Register an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param converter The FromUnmarshaller to be registered
*/
public final <S, T> void registerUnmarshaller(Class<S> source, Class<T> target, FromUnmarshaller<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
597 |
org\jadira\bindings\core\binder\BasicBinder.java |
624 |
org\jadira\bindings\core\binder\BasicBinder.java |
646 |
org\jadira\bindings\core\binder\BasicBinder.java |
892 |
org\jadira\bindings\core\binder\BasicBinder.java |
954 |
org\jadira\bindings\core\binder\BasicBinder.java |
985 |
org\jadira\bindings\core\binder\BasicBinder.java |
1018 |
registerBinding(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier), converter); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
597 |
org\jadira\bindings\core\binder\BasicBinder.java |
624 |
org\jadira\bindings\core\binder\BasicBinder.java |
646 |
org\jadira\bindings\core\binder\BasicBinder.java |
668 |
registerBinding(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier), converter);
}
/**
* Register a Binding with the given source and target class.
* A binding unifies a marshaller and an unmarshaller and both must be available to resolve a binding.
*
* The source class is considered the owning class of the binding. The source can be marshalled
* into the target class. Similarly, the target can be unmarshalled to produce an instance of the source type.
* @param key Converter Key to use
* @param converter The binding to be registered
*/
public final <S, T> void registerBinding(ConverterKey<S,T> key, Binding<S, T> converter) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
794 |
org\jadira\bindings\core\binder\ConversionBinder.java |
56 |
public <S, T> T convertTo(Class<S> input, Class<T> output, Object object) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
807 |
org\jadira\bindings\core\cdi\BinderExtension.java |
129 |
return convertTo(new ConverterKey<S,T>(input, output, qualifier), object);
}
/**
* Convert an object which is an instance of source class to the given target class
* @param key The converter key to use
* @param object The object to be converted
*/
public <S, T> T convertTo(ConverterKey<S,T> key, Object object) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
891 |
org\jadira\bindings\core\binder\BasicBinder.java |
953 |
org\jadira\bindings\core\binder\BasicBinder.java |
984 |
org\jadira\bindings\core\binder\BasicBinder.java |
1017 |
org\jadira\bindings\core\cdi\BinderExtension.java |
176 |
org\jadira\bindings\core\cdi\BinderExtension.java |
192 |
org\jadira\bindings\core\cdi\BinderExtension.java |
208 |
org\jadira\bindings\core\cdi\BinderExtension.java |
224 |
public <S, T> Binding<S, T> findBinding(Class<S> source, Class<T> target, Class<? extends Annotation> qualifier) {
return findBinding(new ConverterKey<S,T>(source, target, qualifier == null ? DefaultBinding.class : qualifier)); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
904 |
org\jadira\bindings\core\cdi\BinderExtension.java |
184 |
public <S, T> Binding<S, T> findBinding(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\ConversionBinder.java |
43 |
org\jadira\bindings\core\binder\ConversionBinder.java |
56 |
<S,T> T convertTo(Class<T> output, Object object, Class<? extends Annotation> qualifier);
// TODO Add find methods equating to convertTo
/**
* Convert an object which is an instance of source class to the given target class
* @param input The class of the object to be converted
* @param output The target class to convert the object to
* @param object The object to be converted
* @param <S> The Source type
* @param <T> The Target type
* @return The result of the conversion
*/
<S, T> T convertTo(Class<S> input, Class<T> output, Object object); |
File |
Line |
org\jadira\bindings\core\general\binding\CompositeBinding.java |
38 |
org\jadira\bindings\core\general\binding\FromBinding.java |
34 |
public CompositeBinding(ToMarshaller<S, T> marshal, FromUnmarshaller<S, T> unmarshal) {
if (unmarshal == null) {
throw new IllegalStateException("Unmarshaller may not be null");
} |
File |
Line |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
37 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
36 |
public final class MethodsBinding<S, T> extends MethodToMarshaller<S, T> implements Binding<S, T> {
private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
private final MethodHandle unmarshalHandle; |
File |
Line |
org\jadira\bindings\core\general\marshaller\ConverterToMarshaller.java |
64 |
org\jadira\bindings\core\general\unmarshaller\ConverterFromUnmarshaller.java |
46 |
public T marshal(S object) {
return converter.convert(object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public Class<S> getBoundClass() {
return converter.getInputClass(); |
File |
Line |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
306 |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
316 |
toMethod = bindingClass.getMethod(toMethodName, new Class[] { targetClass });
} catch (SecurityException e) {
} catch (NoSuchMethodException e) {
}
if (toMethod != null && (!String.class.equals(toMethod.getReturnType()) |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
44 |
org\jadira\bindings\core\binder\BasicBinder.java |
1184 |
return binder.convertTo(String.class, output, object, qualifier);
}
/**
* {@inheritDoc}
*/
/* @Override */
public String convertToString(Object object) {
return binder.convertTo(String.class, object); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
453 |
org\jadira\bindings\core\binder\BasicBinder.java |
993 |
try {
@SuppressWarnings("unchecked")
Converter<S,T> converter = (Converter<S,T>)theBinding.getBindingClass().newInstance(); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
753 |
org\jadira\bindings\core\binder\BasicBinder.java |
824 |
throw new NoConverterFoundException(new ConverterKey<S,T>(inputClass, output, qualifier == null ? DefaultBinding.class : qualifier));
}
@SuppressWarnings("unchecked")
S myObject = (S)object;
return conv.convert(myObject);
} |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
794 |
org\jadira\bindings\core\binder\ConversionBinder.java |
68 |
public <S, T> T convertTo(Class<S> input, Class<T> output, Object object) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
805 |
org\jadira\bindings\core\binder\ConversionBinder.java |
56 |
public <S, T> T convertTo(Class<S> input, Class<T> output, Object object, Class<? extends Annotation> qualifier) { |
File |
Line |
org\jadira\bindings\core\general\binding\CompositeBinding.java |
27 |
org\jadira\bindings\core\general\binding\ToBinding.java |
25 |
public class CompositeBinding<S, T> implements Binding<S, T> {
private final ToMarshaller<S, T> marshal; |
File |
Line |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
67 |
org\jadira\bindings\core\provider\AbstractAnnotationMatchingConverterProvider.java |
71 |
matchedMethods.put(new ConverterKey<I,O>(inputClass, returnType, nextQualifier), method);
} else { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
716 |
org\jadira\bindings\core\cdi\BinderExtension.java |
97 |
}
/******************
* *
* Conversion API *
* *
******************/
/**
* Convert an object to the given target class
* This method infers the source type for the conversion from the runtime type of object.
* @param output The target class to convert the object to
* @param object The object to be converted
*/
public <S, T> T convertTo(Class<T> output, Object object) {
return convertTo(output, object, DefaultBinding.class); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
904 |
org\jadira\bindings\core\binder\SearchableBinder.java |
38 |
org\jadira\bindings\core\cdi\BinderExtension.java |
184 |
public <S, T> Binding<S, T> findBinding(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
962 |
org\jadira\bindings\core\binder\SearchableBinder.java |
48 |
org\jadira\bindings\core\cdi\BinderExtension.java |
200 |
public <S, T> ToMarshaller<S, T> findMarshaller(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
993 |
org\jadira\bindings\core\binder\SearchableBinder.java |
58 |
org\jadira\bindings\core\cdi\BinderExtension.java |
216 |
public <S, T> Converter<S, T> findConverter(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1026 |
org\jadira\bindings\core\binder\SearchableBinder.java |
68 |
org\jadira\bindings\core\cdi\BinderExtension.java |
232 |
public <S, T> FromUnmarshaller<S, T> findUnmarshaller(ConverterKey<S,T> key) { |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
137 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
149 |
org\jadira\bindings\core\binder\RegisterableBinder.java |
161 |
<S, T> void registerBinding(final Class<S> sourceClass, Class<T> targetClass, Binding<S, T> converter, Class<? extends Annotation> qualifier);
/**
* Register an UnMarshaller with the given source and target class.
* The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param sourceClass The source (input) class
* @param targetClass The target (output) class
* @param converter The FromUnmarshaller to be registered
* @param qualifier The qualifier for which the unmarshaller must be registered
* @param <S> Source type
* @param <T> Target type
*/
<S, T> void registerUnmarshaller(Class<S> sourceClass, Class<T> targetClass, FromUnmarshaller<S, T> converter, Class<? extends Annotation> qualifier); |
File |
Line |
org\jadira\bindings\core\general\binding\MethodConstructorBinding.java |
32 |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
37 |
public final class MethodConstructorBinding<S, T> extends MethodToMarshaller<S, T> implements Binding<S, T> {
private final Constructor<S> unmarshal; |
File |
Line |
org\jadira\bindings\core\general\binding\MethodsBinding.java |
37 |
org\jadira\bindings\core\general\marshaller\MethodToMarshaller.java |
49 |
org\jadira\bindings\core\general\unmarshaller\MethodFromUnmarshaller.java |
36 |
public final class MethodsBinding<S, T> extends MethodToMarshaller<S, T> implements Binding<S, T> {
private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
private final MethodHandle unmarshalHandle; |
File |
Line |
org\jadira\bindings\core\general\marshaller\MethodToMarshaller.java |
67 |
org\jadira\bindings\core\general\marshaller\MethodToMarshaller.java |
69 |
if (marshal.getParameterTypes().length == 0 && Modifier.isStatic(marshal.getModifiers())) {
throw new IllegalStateException("marshal method must either be instance scope or define a single parameter");
} else if (marshal.getParameterTypes().length == 1 && (!Modifier.isStatic(marshal.getModifiers()))) { |
File |
Line |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
169 |
org\jadira\bindings\core\loader\BindingXmlLoader.java |
297 |
for (Node next : new IterableNodeList(docRoot.getChildNodes())) {
if (Node.ELEMENT_NODE == next.getNodeType()) {
Element element = (Element) next; |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
43 |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
59 |
public <T> T convertFromString(Class<T> output, String object, Class<? extends Annotation> qualifier) {
return binder.convertTo(String.class, output, object, qualifier); |
File |
Line |
org\jadira\bindings\core\binder\adapter\StringBinderAdapter.java |
52 |
org\jadira\bindings\core\binder\BasicBinder.java |
1188 |
org\jadira\bindings\core\cdi\BinderExtension.java |
378 |
return binder.convertTo(String.class, object);
}
/**
* {@inheritDoc}
*/
/* @Override */
public String convertToString(Object object, Class<? extends Annotation> qualifier) {
return binder.convertTo(String.class, object, qualifier); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
390 |
org\jadira\bindings\core\binder\BasicBinder.java |
408 |
org\jadira\bindings\core\binder\BasicBinder.java |
426 |
org\jadira\bindings\core\binder\BasicBinder.java |
444 |
if (Binding.class.isAssignableFrom(theBinding.getBindingClass())) {
/*
* If the binding class is an instance of the Binding interface then register it.
* When the binding class is an interface, you must define source and target class if they cannot be
* determined from introspecting the interface.
*
* You can optionally supply a qualifier so that the binding is associated with a qualifier
*/
try {
@SuppressWarnings("unchecked") |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
858 |
org\jadira\bindings\core\cdi\BinderExtension.java |
153 |
org\jadira\bindings\core\cdi\BinderExtension.java |
201 |
return findMarshaller(new ConverterKey<S,T>(source, target, DefaultBinding.class));
}
/**
* Resolve a Converter with the given input and output classes. Instances of the input class can be converted into
* instances of the output class
* @param input The input class
* @param output The output class
*/
public <S, T> Converter<S, T> findConverter(Class<S> input, Class<T> output) { |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
910 |
org\jadira\bindings\core\binder\BasicBinder.java |
916 |
if (toTarget instanceof FromUnmarshallerConverter<?, ?>) {
fromUnmarshaller = ((FromUnmarshallerConverter<?, ?>) toTarget).getUnmarshaller(); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
912 |
org\jadira\bindings\core\binder\BasicBinder.java |
918 |
} else if (toTarget instanceof ToMarshallerConverter<?, ?>) {
toMarshaller = ((ToMarshallerConverter<?, ?>) toTarget).getMarshaller(); |
File |
Line |
org\jadira\bindings\core\binder\BasicBinder.java |
1111 |
org\jadira\bindings\core\binder\BasicBinder.java |
1125 |
org\jadira\bindings\core\binder\BasicBinder.java |
1134 |
for(ConverterKey<?,?> currentKey : nextMethods.keySet()) {
if (previouslySeenKeys.contains(currentKey)) {
throw new IllegalStateException("Method is resolved by two converters: " + currentKey.toString()); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
89 |
org\jadira\bindings\core\cdi\BinderExtension.java |
248 |
<S, T> void registerBinding(final Class<S> sourceClass, Class<T> targetClass, Binding<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\RegisterableBinder.java |
122 |
org\jadira\bindings\core\cdi\BinderExtension.java |
272 |
<S, T> void registerConverter(final Class<S> sourceClass, Class<T> targetClass, Converter<S, T> converter); |
File |
Line |
org\jadira\bindings\core\binder\SearchableBinder.java |
82 |
org\jadira\bindings\core\binder\SearchableBinder.java |
93 |
org\jadira\bindings\core\binder\SearchableBinder.java |
104 |
org\jadira\bindings\core\binder\SearchableBinder.java |
115 |
<S, T> Binding<S, T> findBinding(final Class<S> source, final Class<T> target);
/**
* Resolve a Marshaller with the given source and target class.
* The marshaller is used as follows: Instances of the source can be marshalled into the target class.
* @param source The source (input) class
* @param target The target (output) class
* @param <S> The Source type
* @param <T> The Target type
* @return The found Marshaller
*/
<S, T> ToMarshaller<S, T> findMarshaller(final Class<S> source, final Class<T> target); |