コード例 #1
0
  /**
   * Set the resource configuration on the bean populator.
   *
   * @throws SmooksConfigurationException Incorrectly configured resource.
   */
  @Initialize
  public void initialize() throws SmooksConfigurationException {

    if (logger.isDebugEnabled()) {
      logger.debug("Initializing EntityLocatorParameterVisitor with name '" + name + "'");
    }

    beanWiring = wireBeanIdName != null;
    isAttribute = (valueAttributeName != null);

    beanIdStore = appContext.getBeanIdStore();

    if (parameterListType == ParameterListType.NAMED) {
      NamedParameterIndex parameterIndex =
          (NamedParameterIndex) ParameterManager.getParameterIndex(entityLocatorId, appContext);
      parameter = parameterIndex.register(name);
    } else {
      PositionalParameterIndex parameterIndex =
          (PositionalParameterIndex)
              ParameterManager.getParameterIndex(entityLocatorId, appContext);
      parameter = parameterIndex.register(index);
    }

    if (wireBeanIdName != null) {
      wireBeanId = beanIdStore.register(wireBeanIdName);
    }
  }
コード例 #2
0
  public void populateAndSetPropertyValue(Object dataObject, ExecutionContext executionContext) {
    if (dataObject == null) {
      return;
    }

    ParameterContainer<Parameter<?>> container =
        ParameterManager.getParameterContainer(entityLocatorId, executionContext);
    container.put(parameter, dataObject);
  }