/** * Creates a {@code NamespaceContext} for the specified method, based on {@link Namespaces @Namespaces} and {@link * Namespace @Namespace} annotations. * * <p>This method will search for {@link Namespaces @Namespaces} and {@link Namespace @Namespace} annotation in the * given method, its class, and its package, in reverse order. That is: package-level annotations are overridden by * class-level annotations, which again are overridden by method-level annotations. * * @param method the method to create the namespace context for * @return the namespace context */ public static NamespaceContext getNamespaceContext(Method method) { Assert.notNull(method, "'method' must not be null"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); Class<?> endpointClass = method.getDeclaringClass(); Package endpointPackage = endpointClass.getPackage(); if (endpointPackage != null) { addNamespaceAnnotations(endpointPackage, namespaceContext); } addNamespaceAnnotations(endpointClass, namespaceContext); addNamespaceAnnotations(method, namespaceContext); return namespaceContext; }
/** * Creates a {@code NamespaceContext} for the specified method, based on {@link Namespaces @Namespaces} and {@link * Namespace @Namespace} annotations. * <p/> * This method will search for {@link Namespaces @Namespaces} and {@link Namespace @Namespace} annotation in the * given method, its class, and its package, in reverse order. That is: package-level annotations are overridden by * class-level annotations, which again are overridden by method-level annotations. * * @param method the method to create the namespace context for * @return the namespace context */ public static NamespaceContext getNamespaceContext(Method method) { Assert.notNull(method, "'method' must not be null"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); Class<?> endpointClass = method.getDeclaringClass(); Package endpointPackage = endpointClass.getPackage(); if (endpointPackage != null) { addNamespaceAnnotations(endpointPackage, namespaceContext); } addNamespaceAnnotations(endpointClass, namespaceContext); addNamespaceAnnotations(method, namespaceContext); return namespaceContext; }
/** * Creates a {@code NamespaceContext} for the specified method, based on {@link Namespaces @Namespaces} and {@link * Namespace @Namespace} annotations. * * <p>This method will search for {@link Namespaces @Namespaces} and {@link Namespace @Namespace} annotation in the * given method, its class, and its package, in reverse order. That is: package-level annotations are overridden by * class-level annotations, which again are overridden by method-level annotations. * * @param method the method to create the namespace context for * @return the namespace context */ public static NamespaceContext getNamespaceContext(Method method) { Assert.notNull(method, "'method' must not be null"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); Class<?> endpointClass = method.getDeclaringClass(); Package endpointPackage = endpointClass.getPackage(); if (endpointPackage != null) { addNamespaceAnnotations(endpointPackage, namespaceContext); } addNamespaceAnnotations(endpointClass, namespaceContext); addNamespaceAnnotations(method, namespaceContext); return namespaceContext; }
/** * Creates a {@code NamespaceContext} for the specified method, based on {@link Namespaces @Namespaces} and {@link * Namespace @Namespace} annotations. * * <p>This method will search for {@link Namespaces @Namespaces} and {@link Namespace @Namespace} annotation in the * given method, its class, and its package, in reverse order. That is: package-level annotations are overridden by * class-level annotations, which again are overridden by method-level annotations. * * @param method the method to create the namespace context for * @return the namespace context */ public static NamespaceContext getNamespaceContext(Method method) { Assert.notNull(method, "'method' must not be null"); SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); Class<?> endpointClass = method.getDeclaringClass(); Package endpointPackage = endpointClass.getPackage(); if (endpointPackage != null) { addNamespaceAnnotations(endpointPackage, namespaceContext); } addNamespaceAnnotations(endpointClass, namespaceContext); addNamespaceAnnotations(method, namespaceContext); return namespaceContext; }