private void processSource(Class<?> type, Class<?> clazz, Property property, IntrospectionContext context) { Source source = type.getAnnotation(Source.class); if (source != null) { if (!source.value().startsWith("$")) { InvalidAnnotation error = new InvalidAnnotation("Source attribute must specify an expression starting with '$' on:" + type, type, source, clazz); context.addError(error); } else { property.setSource(source.value()); } } }
private void processSource(AccessibleObject accessible, Class<?> clazz, Property property, IntrospectionContext context) { Source source = accessible.getAnnotation(Source.class); if (source != null) { if (!source.value().startsWith("$")) { InvalidAnnotation error = new InvalidAnnotation("Source attribute must specify an expression starting with '$' on:" + accessible, accessible, source, clazz); context.addError(error); } else { property.setSource(source.value()); // handle defined namespaces Component componentAnnotation = clazz.getAnnotation(Component.class); if (componentAnnotation != null) { Namespace[] namespaces = componentAnnotation.namespaces(); for (Namespace namespace : namespaces) { String prefix = namespace.prefix(); String uri = namespace.uri(); property.addNamespace(prefix, uri); } } } } }