ElementOutputModelExpander

Expands:


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

if:

dataElement.component.getOption("enableJaxrs").defined and
    dataElement.getOption('includeJaxrsConnector').defined and
    (dataElement.getOption('exposeGetEndpoint').defined or dataElement.getOption('exposeGetListEndpoint').defined)
property value
element type DataElement
qualified name net.democritus.expander.rest.control.model.ElementOutputModelExpander
layer CONTROL_LAYER
technology JAXRS
sourceType JAVA
phase expansion
features DataElementSwagger

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 com.example.city.model.city;

import com.fasterxml.jackson.annotation.*;

// anchor:valueField-imports:start
import java.util.Date;
// anchor:valueField-imports:end

// anchor:linkField-imports:start
import com.example.model.country.CountryReferenceModel;

import java.util.List;
// anchor:linkField-imports:end

// @anchor:imports:start
import io.swagger.annotations.ApiModelProperty;
// @anchor:imports:end
// anchor:custom-imports:start
// anchor:custom-imports:end

// @anchor:annotations:start
// @anchor:annotations:end
// anchor:custom-annotations:start
// anchor:custom-annotations:end
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CityOutputModel {

  // @anchor:resourceUri-annotations:start
  // @anchor:resourceUri-annotations:end
  // anchor:custom-resourceUri-annotations:start
  // anchor:custom-resourceUri-annotations:end
  private String resourceUri;

  // anchor:valueField-fields:start

  // @anchor:name-annotations:start
  @ApiModelProperty(value = "<p>The official name of the city.</p>")
  // @anchor:name-annotations:end
  // anchor:custom-name-annotations:start
  // anchor:custom-name-annotations:end
  private String name;

  // @anchor:uuid-annotations:start
  // @anchor:uuid-annotations:end
  // anchor:custom-uuid-annotations:start
  // anchor:custom-uuid-annotations:end
  private String uuid;

  // @anchor:postalCode-annotations:start
  // @anchor:postalCode-annotations:end
  // anchor:custom-postalCode-annotations:start
  // anchor:custom-postalCode-annotations:end
  private Integer postalCode;

  // @anchor:enteredAt-annotations:start
  // @anchor:enteredAt-annotations:end
  // anchor:custom-enteredAt-annotations:start
  // anchor:custom-enteredAt-annotations:end
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
  @JsonProperty("created")
  private Date enteredAt;

  // @anchor:lastModifiedAt-annotations:start
  // @anchor:lastModifiedAt-annotations:end
  // anchor:custom-lastModifiedAt-annotations:start
  // anchor:custom-lastModifiedAt-annotations:end
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
  @JsonProperty("lastModified")
  private Date lastModifiedAt;

  // anchor:valueField-fields:end

  // anchor:linkField-fields:start

  // @anchor:country-annotations:start
  // @anchor:country-annotations:end
  // anchor:custom-country-annotations:start
  // anchor:custom-country-annotations:end
  private CountryReferenceModel country;

  // anchor:linkField-fields:end

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

  // @anchor:getResourceUri-annotations:start
  // @anchor:getResourceUri-annotations:end
  // anchor:custom-getResourceUri-annotations:start
  // anchor:custom-getResourceUri-annotations:end
  public String getResourceUri() {
    return this.resourceUri;
  }

  // @anchor:setResourceUri-annotations:start
  // @anchor:setResourceUri-annotations:end
  // anchor:custom-setResourceUri-annotations:start
  // anchor:custom-setResourceUri-annotations:end
  public void setResourceUri(String resourceUri) {
    this.resourceUri = resourceUri;
  }

  // anchor:valueField-accessors:start

  // @anchor:getName-annotations:start
  // @anchor:getName-annotations:end
  // anchor:custom-getName-annotations:start
  // anchor:custom-getName-annotations:end
  public String getName() {
    return this.name;
  }

  // @anchor:setName-annotations:start
  // @anchor:setName-annotations:end
  // anchor:custom-setName-annotations:start
  // anchor:custom-setName-annotations:end
  public void setName(String name) {
    this.name = name;
  }

  // @anchor:getUuid-annotations:start
  // @anchor:getUuid-annotations:end
  // anchor:custom-getUuid-annotations:start
  // anchor:custom-getUuid-annotations:end
  public String getUuid() {
    return this.uuid;
  }

  // @anchor:setUuid-annotations:start
  // @anchor:setUuid-annotations:end
  // anchor:custom-setUuid-annotations:start
  // anchor:custom-setUuid-annotations:end
  public void setUuid(String uuid) {
    this.uuid = uuid;
  }

  // @anchor:getPostalCode-annotations:start
  // @anchor:getPostalCode-annotations:end
  // anchor:custom-getPostalCode-annotations:start
  // anchor:custom-getPostalCode-annotations:end
  public Integer getPostalCode() {
    return this.postalCode;
  }

  // @anchor:setPostalCode-annotations:start
  // @anchor:setPostalCode-annotations:end
  // anchor:custom-setPostalCode-annotations:start
  // anchor:custom-setPostalCode-annotations:end
  public void setPostalCode(Integer postalCode) {
    this.postalCode = postalCode;
  }

  // @anchor:getEnteredAt-annotations:start
  // @anchor:getEnteredAt-annotations:end
  // anchor:custom-getEnteredAt-annotations:start
  // anchor:custom-getEnteredAt-annotations:end
  @JsonGetter("created")
  public Date getEnteredAt() {
    return this.enteredAt;
  }

  // @anchor:setEnteredAt-annotations:start
  // @anchor:setEnteredAt-annotations:end
  // anchor:custom-setEnteredAt-annotations:start
  // anchor:custom-setEnteredAt-annotations:end
  @JsonSetter("created")
  public void setEnteredAt(Date enteredAt) {
    this.enteredAt = enteredAt;
  }

  // @anchor:getLastModifiedAt-annotations:start
  // @anchor:getLastModifiedAt-annotations:end
  // anchor:custom-getLastModifiedAt-annotations:start
  // anchor:custom-getLastModifiedAt-annotations:end
  @JsonGetter("lastModified")
  public Date getLastModifiedAt() {
    return this.lastModifiedAt;
  }

  // @anchor:setLastModifiedAt-annotations:start
  // @anchor:setLastModifiedAt-annotations:end
  // anchor:custom-setLastModifiedAt-annotations:start
  // anchor:custom-setLastModifiedAt-annotations:end
  @JsonSetter("lastModified")
  public void setLastModifiedAt(Date lastModifiedAt) {
    this.lastModifiedAt = lastModifiedAt;
  }

  // anchor:valueField-accessors:end

  // anchor:linkField-accessors:start

  // @anchor:getCountry-annotations:start
  // @anchor:getCountry-annotations:end
  // anchor:custom-getCountry-annotations:start
  // anchor:custom-getCountry-annotations:end
  public CountryReferenceModel getCountry() {
    return this.country;
  }

  // @anchor:setCountry-annotations:start
  // @anchor:setCountry-annotations:end
  // anchor:custom-setCountry-annotations:start
  // anchor:custom-setCountry-annotations:end
  public void setCountry(CountryReferenceModel country) {
    this.country = country;
  }

  // anchor:linkField-accessors:end

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

}