/** * Constructor. * * @param beanRegistry the bean definition registry that will be populated by this reader */ public SchemaTypeAwareXMLBeanDefinitionReader(final BeanDefinitionRegistry beanRegistry) { super(beanRegistry); setDocumentReaderClass(SchemaTypeAwareBeanDefinitionDocumentReader.class); setValidationMode(VALIDATION_XSD); } }
/** * Set whether to hide exceptions in expression execution (default is false). * * @param flag flag to set */ public void setHideExceptions(final boolean flag) { embeddedObject.setHideExceptions(flag); }
/** {@inheritDoc} */ @Override public BeanDefinition parseCustomElement(final Element element) { return parseCustomElement(element, null); }
/** * Constructor. * * @param beanFactory bean factory * @param parent parent context */ public FilesystemGenericApplicationContext(final DefaultListableBeanFactory beanFactory, final ApplicationContext parent) { super(beanFactory, parent); beanFactory.setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer()); }
/** {@inheritDoc} */ @Override protected void doNativeParse(final Element element, final ParserContext parserContext, final BeanDefinitionBuilder builder) { super.doNativeParse(element, parserContext, builder); final List<Element> childProviders = ElementSupport.getChildElements(element, MetadataNamespaceHandler.METADATA_ELEMENT_NAME); builder.addPropertyValue("resolvers", SpringSupport.parseCustomElements(childProviders, parserContext)); } }
/** * Parses the key names from the credential configuration. * * @param keyNameElems the elements to parse * @param builder credential build */ protected void parseKeyNames(final List<Element> keyNameElems, final BeanDefinitionBuilder builder) { if (keyNameElems == null || keyNameElems.isEmpty()) { return; } builder.addPropertyValue("keyNames", SpringSupport.getElementTextContentAsManagedList(keyNameElems)); } }
/** * Return the custom (externally provided) object. * * @return the custom object */ @Nullable public Object getCustomObject() { return embeddedObject.getCustomObject(); }
/** * Set the custom (externally provided) object. * * @param object the custom object */ @Nullable public void setCustomObject(final Object object) { embeddedObject.setCustomObject(object); }
/** {@inheritDoc} */ @Override public Object apply(@Nullable final T context) { return embeddedObject.apply(context); }
/** * Parses the supplied {@link Element} by delegating to the {@link BeanDefinitionParser} that is registered for that * {@link Element}. * * @param element the element to be parsed into a bean definition * @param parserContext the context within which the bean definition is created * * @return the bean definition created from the given element */ @Override public BeanDefinition parse(final Element element, final ParserContext parserContext) { return findParserForElement(element).parse(element, parserContext); }
/** {@inheritDoc} */ @Override protected BeanDefinitionParserDelegate createDelegate(final XmlReaderContext readerContext, final Element root, final BeanDefinitionParserDelegate parentDelegate) { final BeanDefinitionParserDelegate delegate = new SchemaTypeAwareBeanDefinitionParserDelegate(readerContext); delegate.initDefaults(root, parentDelegate); return delegate; }
/** * Decorates the supplied {@link Node} by delegating to the {@link BeanDefinitionDecorator} that is registered to * handle that {@link Node}. * * @param node the node decorating a the given bean definition * @param definition the bean being decorated * @param parserContext the current parser context * * @return the decorated bean definition */ @Override public BeanDefinitionHolder decorate(final Node node, final BeanDefinitionHolder definition, final ParserContext parserContext) { return findDecoratorForNode(node).decorate(node, definition, parserContext); }
/** * Constructor. * * @param beanFactory bean factory */ public FilesystemGenericApplicationContext(final DefaultListableBeanFactory beanFactory) { super(beanFactory); beanFactory.setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer()); }
/** {@inheritDoc} */ @Override protected void doParse(final Element element, final ParserContext parserContext, final BeanDefinitionBuilder builder) { builder.setInitMethodName("initialize"); builder.setDestroyMethodName("destroy"); builder.setLazyInit(true); final List<Element> children = ElementSupport.getChildElements(element, MetadataNamespaceHandler.METADATA_NODE_PROC_ELEMENT_NAME); if (null != children && !children.isEmpty()) { builder.addPropertyValue("nodeProcessors", SpringSupport.parseCustomElements(children, parserContext)); } }
/** * Get the list of audiences from the <Audience> sub-elements. * * @param element the element under discussion * @return the list of elements (which are subject to property replacement) */ protected List<String> getAudiences(final Element element) { final List<Element> audienceElems = ElementSupport.getChildElementsByTagNameNS(element, RelyingPartySAMLNamespaceHandler.NAMESPACE, "Audience"); return SpringSupport.getElementTextContentAsManagedList(audienceElems); }
/** Constructor. */ public FilesystemGenericApplicationContext() { super(); getDefaultListableBeanFactory().setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer()); }
/** * Get the list of proxy audiences from the <ProxyAudience> sub-elements. * * @param element the element under discussion * @return the list of elements (which are subject to property replacement) */ protected List<String> getProxyAudiences(final Element element) { final List<Element> audienceElems = ElementSupport.getChildElementsByTagNameNS(element, RelyingPartySAMLNamespaceHandler.NAMESPACE, "ProxyAudience"); return SpringSupport.getElementTextContentAsManagedList(audienceElems); }
/** * Constructor. * * @param parent parent context */ public FilesystemGenericApplicationContext(final ApplicationContext parent) { super(parent); getDefaultListableBeanFactory().setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer()); }
/** {@inheritDoc} */ @Override protected DefaultListableBeanFactory createBeanFactory() { final DefaultListableBeanFactory result = super.createBeanFactory(); result.setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer()); return result; } }
@Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) public class MethodSecurityConfiguration extends GlobalMethodSecurityConfiguration { @Autowired private ApplicationContext context; @Override protected MethodSecurityExpressionHandler createExpressionHandler() { DefaultMethodSecurityExpressionHandler result = new DefaultMethodSecurityExpressionHandler(); result.setApplicationContext(this.context); result.setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer(PathVariable.class.getName())); return result; } }