- * Applicable to a setter of a single key from the map (e.g. {@code setAttribute}) or an adder to - * a collection (e.g. {@code addWebOrigin}). This is used to override default type generated by the - * generator in case the entry does not exist yet and a new container needs to be instantiated. - * - * Example: - *
- * @GeneratedFieldType(HashSet) void addWebOrigin() { ... }
- *
- *
- * @author hmlnarik
- */
-@Retention(RetentionPolicy.SOURCE)
-@Target(ElementType.METHOD)
-public @interface GeneratedFieldType {
- Class> value() default Void.class;
-}
diff --git a/model/build-processor/src/main/java/org/keycloak/models/map/annotations/IgnoreForEntityImplementationGenerator.java b/model/build-processor/src/main/java/org/keycloak/models/map/annotations/IgnoreForEntityImplementationGenerator.java
deleted file mode 100644
index ec03ffeda91..00000000000
--- a/model/build-processor/src/main/java/org/keycloak/models/map/annotations/IgnoreForEntityImplementationGenerator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2021 Red Hat, Inc. and/or its affiliates
- * and other contributors as indicated by the @author tags.
- *
- * 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
- *
- * http://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.keycloak.models.map.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- *
- * @author hmlnarik
- */
-@Retention(RetentionPolicy.CLASS)
-@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})
-public @interface IgnoreForEntityImplementationGenerator {
-}
diff --git a/model/build-processor/src/main/java/org/keycloak/models/map/exceptions/CannotMigrateTypeException.java b/model/build-processor/src/main/java/org/keycloak/models/map/exceptions/CannotMigrateTypeException.java
deleted file mode 100644
index fd2e8de3e68..00000000000
--- a/model/build-processor/src/main/java/org/keycloak/models/map/exceptions/CannotMigrateTypeException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2021 Red Hat, Inc. and/or its affiliates
- * and other contributors as indicated by the @author tags.
- *
- * 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
- *
- * http://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.keycloak.models.map.exceptions;
-
-import javax.lang.model.type.TypeMirror;
-import java.util.Arrays;
-import java.util.stream.Collectors;
-
-public class CannotMigrateTypeException extends RuntimeException {
- private final TypeMirror toType;
- private final TypeMirror[] fromType;
-
- public CannotMigrateTypeException(TypeMirror toType, TypeMirror[] fromType) {
- this.toType = toType;
- this.fromType = fromType;
- }
-
- public String getFormattedMessage() {
- return "Cannot migrate [" + Arrays.stream(fromType).map(TypeMirror::toString).collect(Collectors.joining(", ")) + "] to " + toType.toString();
- }
-
-}
diff --git a/model/build-processor/src/main/java/org/keycloak/models/map/processor/AbstractGenerateEntityImplementationsProcessor.java b/model/build-processor/src/main/java/org/keycloak/models/map/processor/AbstractGenerateEntityImplementationsProcessor.java
deleted file mode 100644
index 7da921dd2e2..00000000000
--- a/model/build-processor/src/main/java/org/keycloak/models/map/processor/AbstractGenerateEntityImplementationsProcessor.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright 2021 Red Hat, Inc. and/or its affiliates
- * and other contributors as indicated by the @author tags.
- *
- * 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
- *
- * http://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.keycloak.models.map.processor;
-
-import org.keycloak.models.map.annotations.CollectionKey;
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.RoundEnvironment;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.ExecutableElement;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.Name;
-import javax.lang.model.element.TypeElement;
-import javax.lang.model.type.NoType;
-import javax.lang.model.type.TypeKind;
-import javax.lang.model.type.TypeMirror;
-import javax.lang.model.util.Elements;
-import javax.lang.model.util.Types;
-import javax.tools.Diagnostic;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.annotation.processing.SupportedSourceVersion;
-import javax.lang.model.SourceVersion;
-import static org.keycloak.models.map.processor.FieldAccessorType.GETTER;
-import static org.keycloak.models.map.processor.Util.getGenericsDeclaration;
-import static org.keycloak.models.map.processor.Util.isMapType;
-import static org.keycloak.models.map.processor.Util.isSetType;
-import static org.keycloak.models.map.processor.Util.singularToPlural;
-
-@SupportedSourceVersion(SourceVersion.RELEASE_8)
-public abstract class AbstractGenerateEntityImplementationsProcessor extends AbstractProcessor {
-
- protected static final String FQN_DEEP_CLONER = "org.keycloak.models.map.common.DeepCloner";
- protected static final String FQN_ENTITY_FIELD = "org.keycloak.models.map.common.EntityField";
- protected static final String FQN_HAS_ENTITY_FIELD_DELEGATE = "org.keycloak.models.map.common.delegate.HasEntityFieldDelegate";
- protected static final String FQN_ENTITY_FIELD_DELEGATE = "org.keycloak.models.map.common.delegate.EntityFieldDelegate";
-
- protected Elements elements;
- protected Types types;
-
- protected static interface Generator {
- void generate(TypeElement e) throws IOException;
- }
-
- @Override
- public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
- elements = processingEnv.getElementUtils();
- types = processingEnv.getTypeUtils();
-
- for (TypeElement annotation : annotations) {
- Set extends Element> annotatedElements = roundEnv.getElementsAnnotatedWith(annotation);
- annotatedElements.stream()
- .map(TypeElement.class::cast)
- .filter(this::testAnnotationElement)
- .forEach(this::processTypeElement);
- }
-
- if (!annotations.isEmpty()) {
- afterAnnotationProcessing();
- }
-
- return true;
- }
-
- public ExecutableElement getCollectionKey(TypeMirror fieldType, ExecutableElement callingMethod) {
- if (! Util.isCollectionType(elements.getTypeElement(types.erasure(fieldType).toString()))) {
- processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "Invalid collection type: " + fieldType, callingMethod);
- return null;
- }
-
- TypeMirror collectionType = getGenericsDeclaration(fieldType).get(0);
- TypeElement collectionTypeEl = elements.getTypeElement(types.erasure(collectionType).toString());
-
- Iterator
- * This transformer handles only a values of a single node in structured file, i.e.
- * single value (a primitive value, sequence or mapping). The root level
- * is at the beginning of e.g. YAML or JSON document.
- * Every mapping key and every sequence value then represents next level of nesting.
- *
- * @author hmlnarik
- * @param
- * Called after reading a map entry (both key and value) from the YAML file is finished.
- * The entry is represented as {@code name} parameter (key part of the entry)
- * and {@code value} (value part of the entry).
- *
- * The method is called in the same order as the mapping items appear in the source YAML mapping.
- *
- * @param name
- * @param value
- */
- default void add(String name, Object value) { };
-
- /**
- * Modifies the {@link #getResult() result returned} from within this context by
- * providing the read primitive value or a single sequence item in the {@code value} parameter.
- *
- * Called after reading a primitive value or a single sequence item
- * from the YAML file is finished.
- *
- * If the parsed YAML part was a sequence, this method is called in the same order
- * as the sequence items appear in the source YAML sequence.
- *
- * @param value
- */
- default void add(Object value) { };
-
- /**
- * Returns the result of parsing the given part of YAML file.
- * @return
- */
- V getResult();
-
- Class> getScalarType();
-
- public static class DefaultObjectContext