Package ca.uhn.fhir.model.api.annotation

Examples of ca.uhn.fhir.model.api.annotation.ResourceDef


    } else {
      throw new ConfigurationException("Invalid return type '" + methodReturnType.getCanonicalName() + "' on method '" + theMethod.getName() + "' on type: " + theMethod.getDeclaringClass().getCanonicalName());
    }

    if (theReturnResourceType != null) {
      ResourceDef resourceDefAnnotation = theReturnResourceType.getAnnotation(ResourceDef.class);
      if (resourceDefAnnotation == null) {
        throw new ConfigurationException(theReturnResourceType.getCanonicalName() + " has no @" + ResourceDef.class.getSimpleName() + " annotation");
      }
      myResourceName = resourceDefAnnotation.name();
    }
  }
View Full Code Here


      throw new ConfigurationException("Invalid return type '" + methodReturnType.getCanonicalName() + "' on method '" + theMethod.getName() + "' on type: " + theMethod.getDeclaringClass().getCanonicalName());
    }

    myResourceType = theReturnResourceType;
    if (theReturnResourceType != null) {
      ResourceDef resourceDefAnnotation = theReturnResourceType.getAnnotation(ResourceDef.class);
      if (resourceDefAnnotation == null) {
        throw new ConfigurationException(theReturnResourceType.getCanonicalName() + " has no @" + ResourceDef.class.getSimpleName() + " annotation");
      }
      myResourceName = resourceDefAnnotation.name();
    }
  }
View Full Code Here

    BaseRuntimeElementDefinition<?> existingDef = myClassToElementDefinitions.get(theClass);
    if (existingDef != null) {
      return;
    }

    ResourceDef resourceDefinition = theClass.getAnnotation(ResourceDef.class);
    if (resourceDefinition != null) {
      if (!IResource.class.isAssignableFrom(theClass)) {
        throw new ConfigurationException("Resource type contains a @" + ResourceDef.class.getSimpleName() + " annotation but does not implement " + IResource.class.getCanonicalName() + ": " + theClass.getCanonicalName());
      }
      @SuppressWarnings("unchecked")
View Full Code Here

    }

    if (theReturnResourceType != null) {
      if (IResource.class.isAssignableFrom(theReturnResourceType)) {
        myResourceType = theReturnResourceType;
        ResourceDef resourceDefAnnotation = theReturnResourceType.getAnnotation(ResourceDef.class);
        if (resourceDefAnnotation == null) {
          throw new ConfigurationException(theReturnResourceType.getCanonicalName() + " has no @" + ResourceDef.class.getSimpleName() + " annotation");
        }
        myResourceName = resourceDefAnnotation.name();
      }
    }
  }
View Full Code Here

    BaseRuntimeElementDefinition<?> existingDef = myClassToElementDefinitions.get(theClass);
    if (existingDef != null) {
      return;
    }

    ResourceDef resourceDefinition = theClass.getAnnotation(ResourceDef.class);
    if (resourceDefinition != null) {
      if (!IResource.class.isAssignableFrom(theClass)) {
        throw new ConfigurationException("Resource type contains a @" + ResourceDef.class.getSimpleName() + " annotation but does not implement " + IResource.class.getCanonicalName() + ": " + theClass.getCanonicalName());
      }
      @SuppressWarnings("unchecked")
View Full Code Here

    String resourceName = resourceDefinition.name();
    if (isBlank(resourceName)) {
      Class<?> parent = theClass.getSuperclass();
      primaryNameProvider = false;
      while (parent.equals(Object.class) == false && isBlank(resourceName)) {
        ResourceDef nextDef = parent.getAnnotation(ResourceDef.class);
        if (nextDef != null) {
          resourceName = nextDef.name();
        }
        parent = parent.getSuperclass();
      }
      if (isBlank(resourceName)) {
        throw new ConfigurationException("Resource type @" + ResourceDef.class.getSimpleName() + " annotation contains no resource name(): " + theClass.getCanonicalName() + " - This is only allowed for types that extend other resource types ");
View Full Code Here

      throw new ConfigurationException("Invalid return type '" + methodReturnType.getCanonicalName() + "' on method '" + theMethod.getName() + "' on type: " + theMethod.getDeclaringClass().getCanonicalName());
    }

    myResourceType = theReturnResourceType;
    if (theReturnResourceType != null) {
      ResourceDef resourceDefAnnotation = theReturnResourceType.getAnnotation(ResourceDef.class);
      if (resourceDefAnnotation == null) {
        throw new ConfigurationException(theReturnResourceType.getCanonicalName() + " has no @" + ResourceDef.class.getSimpleName() + " annotation");
      }
      myResourceName = resourceDefAnnotation.name();
    }
  }
View Full Code Here

    BaseRuntimeElementDefinition<?> existingDef = myClassToElementDefinitions.get(theClass);
    if (existingDef != null) {
      return;
    }

    ResourceDef resourceDefinition = theClass.getAnnotation(ResourceDef.class);
    if (resourceDefinition != null) {
      if (!IResource.class.isAssignableFrom(theClass)) {
        throw new ConfigurationException("Resource type contains a @" + ResourceDef.class.getSimpleName() + " annotation but does not implement " + IResource.class.getCanonicalName() + ": " + theClass.getCanonicalName());
      }
      @SuppressWarnings("unchecked")
View Full Code Here

    BaseRuntimeElementDefinition<?> existingDef = myClassToElementDefinitions.get(theClass);
    if (existingDef != null) {
      return;
    }

    ResourceDef resourceDefinition = theClass.getAnnotation(ResourceDef.class);
    if (resourceDefinition != null) {
      if (!IResource.class.isAssignableFrom(theClass)) {
        throw new ConfigurationException("Resource type contains a @" + ResourceDef.class.getSimpleName() + " annotation but does not implement " + IResource.class.getCanonicalName() + ": " + theClass.getCanonicalName());
      }
      @SuppressWarnings("unchecked")
View Full Code Here

    } else {
      throw new ConfigurationException("Invalid return type '" + methodReturnType.getCanonicalName() + "' on method '" + theMethod.getName() + "' on type: " + theMethod.getDeclaringClass().getCanonicalName());
    }

    if (theReturnResourceType != null) {
      ResourceDef resourceDefAnnotation = theReturnResourceType.getAnnotation(ResourceDef.class);
      if (resourceDefAnnotation == null) {
        throw new ConfigurationException(theReturnResourceType.getCanonicalName() + " has no @" + ResourceDef.class.getSimpleName() + " annotation");
      }
      myResourceName = resourceDefAnnotation.name();
    }
  }
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.api.annotation.ResourceDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.