Class ReferenceCreator


  • public class ReferenceCreator
    extends Object
    Here we create references to things that might not yet exist. We store all references to be created later.
    Author:
    Phillip Kruger (phillip.kruger@redhat.com)
    • Method Detail

      • clear

        public void clear()
        Clear the scanned references. This is done when we created all references and do not need to remember what to scan.
      • values

        public Queue<Reference> values​(ReferenceType referenceType)
        Get the values for a certain type
        Parameters:
        referenceType - the type
        Returns:
        the references
      • createReferenceForAdapter

        public Reference createReferenceForAdapter​(Direction direction,
                                                   org.jboss.jandex.Type fieldType,
                                                   Annotations annotations)
        Get a reference to a field type for an adapter on a field
        Parameters:
        direction - the direction
        fieldType - the java type
        annotations - annotation on this operations method
        Returns:
        a reference to the type
      • createReferenceForOperationField

        public Reference createReferenceForOperationField​(org.jboss.jandex.Type fieldType,
                                                          Annotations annotationsForMethod)
        Get a reference to a field type for an operation Direction is OUT on a field (and IN on an argument) In the case of operations, there is no fields (only methods)
        Parameters:
        fieldType - the java type
        annotationsForMethod - annotation on this operations method
        Returns:
        a reference to the type
      • createReferenceForOperationArgument

        public Reference createReferenceForOperationArgument​(org.jboss.jandex.Type argumentType,
                                                             Annotations annotationsForThisArgument)
        Get a reference to a argument type for an operation Direction is IN on an argument (and OUT on a field) In the case of operation, there is no field (only methods)
        Parameters:
        argumentType - the java type
        annotationsForThisArgument - annotations on this argument
        Returns:
        a reference to the argument
      • createReferenceForSourceArgument

        public Reference createReferenceForSourceArgument​(org.jboss.jandex.Type argumentType,
                                                          Annotations annotationsForThisArgument)
        Get a reference to a source argument type for an operation Direction is OUT on an argument.
        Parameters:
        argumentType - the java type
        annotationsForThisArgument - annotations on this argument
        Returns:
        a reference to the argument
      • createReferenceForInterfaceField

        public Reference createReferenceForInterfaceField​(org.jboss.jandex.Type methodType,
                                                          Annotations annotationsForThisMethod,
                                                          Reference parentObjectReference)
        Get a reference to a field (method response) on an interface Interfaces is only usable on Type, so the direction in OUT.
        Parameters:
        methodType - the method response type
        annotationsForThisMethod - annotations on this method
        Returns:
        a reference to the type
      • createReferenceForPojoField

        public Reference createReferenceForPojoField​(Direction direction,
                                                     org.jboss.jandex.Type fieldType,
                                                     org.jboss.jandex.Type methodType,
                                                     Annotations annotations,
                                                     Reference parentObjectReference)
        Get a reference to a Field Type for a InputType or Type. We need both the type and the getter/setter method as both is applicable.
        Parameters:
        direction - in or out
        fieldType - the field type
        methodType - the method type
        annotations - the annotations on the field and method
        parentObjectReference - Reference of the parent PoJo use so we can evaluate generics types
        Returns:
        a reference to the type
      • createReference

        public Reference createReference​(Direction direction,
                                         org.jboss.jandex.ClassInfo classInfo)
        This method create a reference to type that might not yet exist. It also store to be created later, if we do not already know about it.
        Parameters:
        direction - the direction (in or out)
        classInfo - the Java class
        Returns:
        a reference
      • createReference

        public Reference createReference​(Direction direction,
                                         org.jboss.jandex.ClassInfo classInfo,
                                         boolean createAdapedToType,
                                         boolean createAdapedWithType,
                                         Reference parentObjectReference,
                                         Map<String,​Reference> parametrizedTypeArgumentsReferences,
                                         boolean addParametrizedTypeNameExtension)
        This method create a reference to type that might not yet exist. It also store to be created later, if we do not already know about it.
        Parameters:
        direction - the direction (in or out)
        classInfo - the Java class
        createAdapedToType - create the type in the schema
        Returns:
        a reference
      • collectParametrizedTypes

        public Map<String,​Reference> collectParametrizedTypes​(org.jboss.jandex.ClassInfo classInfo,
                                                                    List<? extends org.jboss.jandex.Type> parametrizedTypeArguments,
                                                                    Direction direction,
                                                                    Reference parentObjectReference)
      • findParametrizedParentType

        public org.jboss.jandex.ParameterizedType findParametrizedParentType​(org.jboss.jandex.ClassInfo classInfo)