Esempio n. 1
0
  private static void adjust(
      final Method method, final List<ObjectAdapter> args, final AdapterManager adapterManager) {
    final Class<?>[] parameterTypes = method.getParameterTypes();
    ListExtensions.adjust(args, parameterTypes.length);

    for (int i = 0; i < parameterTypes.length; i++) {
      final Class<?> cls = parameterTypes[i];
      if (args.get(i) == null && cls.isPrimitive()) {
        final Object object = ClassExtensions.toDefault(cls);
        final ObjectAdapter adapter = adapterManager.adapterFor(object);
        args.set(i, adapter);
      }
    }
  }
  public ObjectSpecificationAbstract(
      final Class<?> introspectedClass,
      final String shortName,
      final SpecificationContext specificationContext,
      final ObjectMemberContext objectMemberContext) {

    this.correspondingClass = introspectedClass;
    this.fullName = introspectedClass.getName();
    this.shortName = shortName;

    this.isAbstract = ClassExtensions.isAbstract(introspectedClass);
    this.identifier = Identifier.classIdentifier(introspectedClass);

    this.deploymentCategory = specificationContext.getDeploymentCategory();
    this.authenticationSessionProvider = specificationContext.getAuthenticationSessionProvider();
    this.servicesProvider = specificationContext.getServicesProvider();
    this.objectInstantiator = specificationContext.getObjectInstantiator();
    this.specificationLookup = specificationContext.getSpecificationLookup();
    this.facetProcessor = specificationContext.getFacetProcessor();

    this.objectMemberContext = objectMemberContext;
  }