All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.webcohesion.enunciate.modules.jaxws.api.impl.ParameterImpl Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package com.webcohesion.enunciate.modules.jaxws.api.impl;

import com.webcohesion.enunciate.api.Styles;
import com.webcohesion.enunciate.api.datatype.DataTypeReference;
import com.webcohesion.enunciate.api.services.Parameter;
import com.webcohesion.enunciate.javac.javadoc.JavaDoc;
import com.webcohesion.enunciate.modules.jaxb.api.impl.DataTypeReferenceImpl;
import com.webcohesion.enunciate.modules.jaxws.model.WebParam;

import javax.lang.model.element.AnnotationMirror;
import java.util.Map;
import java.util.Set;

/**
 * @author Ryan Heaton
 */
public class ParameterImpl implements Parameter {

  private final WebParam param;

  public ParameterImpl(WebParam param) {
    this.param = param;
  }

  @Override
  public String getName() {
    String name = this.param.getSimpleName().toString();
    if (!name.equals(param.getBaseParamName())) {
      name += " (" + param.getBaseParamName() + ")";
    }
    return name;
  }

  @Override
  public String getDescription() {
    return this.param.getDocValue();
  }

  @Override
  public DataTypeReference getDataType() {
    return new DataTypeReferenceImpl(this.param.getXmlType(), false);
  }

  @Override
  public Map getAnnotations() {
    return this.param.getAnnotations();
  }

  @Override
  public JavaDoc getJavaDoc() {
    return this.param.getJavaDoc();
  }

  @Override
  public Set getStyles() {
    return Styles.gatherStyles(this.param, this.param.getContext().getContext().getConfiguration().getAnnotationStyles());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy