ElementPostInputMapperExpander

Expands:


    $componentRoot.directory$/$artifactSubFolders$/$dataElement.packageName;format="toPath"$/mapper/$dataElement.name;format="firstToLower"$
  /$dataElement.name$PostInputMapper.java

if:

dataElement.component.getOption('enableJaxrs').defined and
    dataElement.getOption('includeJaxrsConnector').defined and
    dataElement.getOption('exposePostEndpoint').defined and
    !dataElement.dataCommands.{^ #this.name.equals('create' + dataElement.name) }.empty
property value
element type DataElement
qualified name net.democritus.expander.rest.control.mapper.ElementPostInputMapperExpander
layer CONTROL_LAYER
technology JAXRS
sourceType JAVA
phase expansion
features  

Example

Some example of the content generated by the expander:

// expanded with nsx-expanders:4.16.3, expansionResource net.democritus:rest-expanders:2.4.2
package net.animals.mapper.catBreed;

import net.animals.CatBreedCommand;
import net.animals.model.catBreed.CatBreedPostInputModel;

import net.democritus.sys.Context;
import net.democritus.sys.ParameterContext;

// @anchor:imports:start
// @anchor:imports:end
// anchor:custom-imports:start
// anchor:custom-imports:end

public class CatBreedPostInputMapper {

  // anchor:custom-fields:start
  // anchor:custom-fields:end

  // @anchor:fields:start
  // @anchor:fields:end

  public CatBreedCommand.CreateCatBreed toInternal(ParameterContext<CatBreedPostInputModel> inputModelParameter) {
    Context context = inputModelParameter.getContext();
    CatBreedPostInputModel inputModel = inputModelParameter.getValue();
    CatBreedCommand.CreateCatBreed command = new CatBreedCommand.CreateCatBreed();
    command.setName(inputModel.getName());
    command.setCountry(inputModel.getCountry());
    command.setOrigin(inputModel.getOrigin());
    command.setCoatLength(inputModel.getCoatLength());
    // @anchor:mapping:start
    // @anchor:mapping:end
    // anchor:custom-mapping:start
    // anchor:custom-mapping:end

    return command;
  }

  // @anchor:methods:start
  // @anchor:methods:end
  // anchor:custom-methods:start
  // anchor:custom-methods:end

}

These expanders have the same isApplicable as ElementPostInputMapperExpander.