keycloakjar.org.springframework.beans.factory.groovy.GroovyDynamicElementReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of camunda-platform-7-keycloak-all Show documentation
Show all versions of camunda-platform-7-keycloak-all Show documentation
Camunda 7 Keycloak Identity Provider Plugin including all transitive dependencies
/*
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.groovy;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Map;
import groovy.lang.Closure;
import groovy.lang.GroovyObject;
import groovy.lang.GroovyObjectSupport;
import groovy.lang.Writable;
import groovy.xml.StreamingMarkupBuilder;
import org.w3c.dom.Element;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate;
import org.springframework.lang.Nullable;
/**
* Used by GroovyBeanDefinitionReader to read a Spring XML namespace expression
* in the Groovy DSL.
*
* @author Jeff Brown
* @author Juergen Hoeller
* @author Dave Syer
* @since 4.0
*/
class GroovyDynamicElementReader extends GroovyObjectSupport {
private final String rootNamespace;
private final Map xmlNamespaces;
private final BeanDefinitionParserDelegate delegate;
private final GroovyBeanDefinitionWrapper beanDefinition;
protected final boolean decorating;
private boolean callAfterInvocation = true;
public GroovyDynamicElementReader(String namespace, Map namespaceMap,
BeanDefinitionParserDelegate delegate, GroovyBeanDefinitionWrapper beanDefinition, boolean decorating) {
this.rootNamespace = namespace;
this.xmlNamespaces = namespaceMap;
this.delegate = delegate;
this.beanDefinition = beanDefinition;
this.decorating = decorating;
}
@Override
@Nullable
public Object invokeMethod(String name, Object obj) {
Object[] args = (Object[]) obj;
if (name.equals("doCall")) {
@SuppressWarnings("unchecked")
Closure