Class GizmoSolutionClonerImplementor


  • public class GizmoSolutionClonerImplementor
    extends Object
    • Field Detail

      • GET_METHOD

        protected static final io.quarkus.gizmo.MethodDescriptor GET_METHOD
    • Constructor Detail

      • GizmoSolutionClonerImplementor

        public GizmoSolutionClonerImplementor()
    • Method Detail

      • getInstanceOfComparator

        public static Comparator<Class<?>> getInstanceOfComparator​(Set<Class<?>> deepClonedClassSet)
        Return a comparator that sorts classes into instanceof check order. In particular, if x is a subclass of y, then x will appear earlier than y in the list.
        Parameters:
        deepClonedClassSet - The set of classes to generate a comparator for
        Returns:
        A comparator that sorts classes from deepClonedClassSet such that x < y if x is assignable from y.
      • createFields

        protected void createFields​(io.quarkus.gizmo.ClassCreator classCreator)
      • defineClonerFor

        public static void defineClonerFor​(io.quarkus.gizmo.ClassCreator classCreator,
                                           SolutionDescriptor<?> solutionDescriptor,
                                           Set<Class<?>> solutionClassSet,
                                           Map<Class<?>,​GizmoSolutionOrEntityDescriptor> memoizedSolutionOrEntityDescriptorMap,
                                           Set<Class<?>> deepClonedClassSet)
        Generates the constructor and implementations of SolutionCloner methods for the given SolutionDescriptor using the given ClassCreator
      • createClassOutputWithDebuggingCapability

        public static io.quarkus.gizmo.ClassOutput createClassOutputWithDebuggingCapability​(MutableReference<byte[]> classBytecodeHolder)
      • createSetSolutionDescriptor

        protected void createSetSolutionDescriptor​(io.quarkus.gizmo.ClassCreator classCreator,
                                                   SolutionDescriptor<?> solutionDescriptor)
      • getEntityHelperMethodName

        protected String getEntityHelperMethodName​(Class<?> entityClass)
      • createUnknownClassHandler

        protected io.quarkus.gizmo.BytecodeCreator createUnknownClassHandler​(io.quarkus.gizmo.BytecodeCreator bytecodeCreator,
                                                                             SolutionDescriptor<?> solutionDescriptor,
                                                                             Class<?> entityClass,
                                                                             io.quarkus.gizmo.ResultHandle toClone,
                                                                             io.quarkus.gizmo.ResultHandle cloneMap)
        Writes the following code:

        In Quarkus: (nothing)

        Outside Quarkus:

         if (toClone.getClass() != entityClass) {
             Cloner.fallbackCloner.gizmoFallbackDeepClone(toClone, cloneMap);
         } else {
             ...
         }
         
        Returns:
        The else branch BytecodeCreator outside of Quarkus, the original bytecodeCreator otherwise.