Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2014-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.grails.config
import groovy.transform.Canonical
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import org.codehaus.groovy.runtime.DefaultGroovyMethods
import org.codehaus.groovy.runtime.typehandling.GroovyCastException
import org.yaml.snakeyaml.LoaderOptions
import org.yaml.snakeyaml.Yaml
import org.yaml.snakeyaml.constructor.SafeConstructor
import grails.config.ConfigMap
import grails.util.Environment
/**
* A {@link ConfigMap} implementation used at codegen time
*
* @author Lari Hotari
* @author Graeme Rocher
*
* @since 3.0
*/
@CompileStatic
@Canonical
class CodeGenConfig implements Cloneable, ConfigMap {
final NavigableMap configMap
GroovyClassLoader groovyClassLoader = new GroovyClassLoader(CodeGenConfig.getClassLoader())
CodeGenConfig() {
this.configMap = new NavigableMap()
}
CodeGenConfig(CodeGenConfig copyOf) {
this((Map) copyOf.getConfigMap())
}
CodeGenConfig(Map copyOf) {
this()
mergeMap(copyOf)
}
CodeGenConfig clone() {
new CodeGenConfig(this)
}
@Override
int size() {
this.configMap.size()
}
@Override
boolean isEmpty() {
this.configMap.isEmpty()
}
@Override
boolean containsKey(Object key) {
this.configMap.containsKey(key)
}
@Override
boolean containsValue(Object value) {
this.configMap.containsValue(value)
}
@Override
Object get(Object key) {
this.configMap.get(key)
}
@Override
Object put(String key, Object value) {
this.configMap.put(key, value)
}
@Override
Object remove(Object key) {
throw new UnsupportedOperationException('Config cannot be mutated')
}
@Override
void putAll(Map extends String, ?> m) {
throw new UnsupportedOperationException('Config cannot be mutated')
}
@Override
void clear() {
throw new UnsupportedOperationException('Config cannot be mutated')
}
@Override
Set keySet() {
this.configMap.keySet()
}
@Override
Collection