gpt4 book ai didi

org.codehaus.enunciate.contract.jaxws.WebMethod.getPosition()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 10:11:05 26 4
gpt4 key购买 nike

本文整理了Java中org.codehaus.enunciate.contract.jaxws.WebMethod.getPosition()方法的一些代码示例,展示了WebMethod.getPosition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebMethod.getPosition()方法的具体详情如下:
包路径:org.codehaus.enunciate.contract.jaxws.WebMethod
类名称:WebMethod
方法名:getPosition

WebMethod.getPosition介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

public SourcePosition getPosition() {
  return method.getPosition();
 }
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

public SourcePosition getPosition() {
  return webMethod.getPosition();
 }
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

public SourcePosition getPosition() {
  return webMethod.getPosition();
 }
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

/**
 * Validates a request wrapper.
 *
 * @param wrapper        The wrapper.
 * @param alreadyVisited The list of bean names already visited.
 * @return The validation result.
 */
public ValidationResult validateRequestWrapper(RequestWrapper wrapper, Set<String> alreadyVisited) {
 AnnotationProcessorEnvironment ape = Context.getCurrentEnvironment();
 ValidationResult result = new ValidationResult();
 String requestBeanName = wrapper.getRequestBeanName();
 if (!alreadyVisited.add(requestBeanName)) {
  result.addError(wrapper.getWebMethod().getPosition(), requestBeanName + " conflicts with another generated bean name.  Please use the @RequestWrapper " +
   "annotation to customize the bean name.");
 }
 else if (ape.getTypeDeclaration(requestBeanName) != null) {
  result.addError(wrapper.getWebMethod().getPosition(), requestBeanName + " is an existing class.  Either move it, or customize the request bean " +
   "class name with the @RequestWrapper annotation.");
 }
 return result;
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

/**
 * Validates a response wrapper.
 *
 * @param wrapper        The wrapper.
 * @param alreadyVisited The list of bean names already visited.
 * @return The validation result.
 */
public ValidationResult validateResponseWrapper(ResponseWrapper wrapper, Set<String> alreadyVisited) {
 AnnotationProcessorEnvironment ape = Context.getCurrentEnvironment();
 ValidationResult result = new ValidationResult();
 String responseBeanName = wrapper.getResponseBeanName();
 if (!alreadyVisited.add(responseBeanName)) {
  result.addError(wrapper.getWebMethod().getPosition(), responseBeanName + " conflicts with another generated bean name.  Please use the @ResponseWrapper " +
   "annotation to customize the bean name.");
 }
 else if (ape.getTypeDeclaration(responseBeanName) != null) {
  result.addError(wrapper.getWebMethod().getPosition(), responseBeanName + " is an existing class.  Either move it, or customize the response bean " +
   "class name with the @ResponseWrapper annotation.");
 }
 return result;
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

@Override
public ValidationResult validateEndpointInterface(EndpointInterface ei) {
 ValidationResult result = new ValidationResult();
 HashSet<String> uniqueMethodNames = new HashSet<String>();
 for (WebMethod webMethod : ei.getWebMethods()) {
  if (!uniqueMethodNames.add(webMethod.getSimpleName())) {
   result.addError(webMethod.getPosition(), "Sorry, the xfire client module doesn't support overloaded methods yet.  Unfortunately, each method has " +
    "to have a unique name.");
  }
  for (WebParam webParam : webMethod.getWebParameters()) {
   if (webParam.isOutput()) {
    //todo: add support for in in/out parameters.
    result.addError(webParam.getPosition(), "The xfire client module doesn't support IN/OUT or OUT parameters yet....");
   }
  }
 }
 return result;
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

/**
 * Gets the xml type of this result.
 *
 * @return The xml type of this result.
 */
public XmlType getXmlType() {
 try {
  XmlType xmlType = XmlTypeFactory.findSpecifiedType(this);
  if (xmlType == null) {
   xmlType = XmlTypeFactory.getXmlType(getType());
  }
  return xmlType;
 }
 catch (XmlTypeException e) {
  throw new ValidationException(method.getPosition(), e.getMessage());
 }
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

for (ReferenceType referenceType : getThrownTypes()) {
 if (!(referenceType instanceof DeclaredType)) {
  throw new ValidationException(getPosition(), "Thrown type must be a declared type.");
  throw new ValidationException(getPosition(), "Unknown declaration for " + referenceType);

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

for (ReferenceType referenceType : getThrownTypes()) {
 if (!(referenceType instanceof DeclaredType)) {
  throw new ValidationException(getPosition(), "Method " + getSimpleName() + " of " + endpointInterface.getQualifiedName() + ": Thrown type must be a declared type.");
  throw new ValidationException(getPosition(), "Method " + getSimpleName() + " of " + endpointInterface.getQualifiedName() + ": unknown declaration for " + referenceType);

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

result.addError(webMethod.getPosition(), "Enunciate doesn't allow declaring a target namespace for a request wrapper that is different " +
    "from the target namespace of the endpoint interface.  If you really must, declare the parameter style BARE and use an xml root element from " +
    "another namespace for the parameter.");
   result.addError(webMethod.getPosition(), "Enunciate doesn't allow declaring a target namespace for a response wrapper that is " +
    "different from the target namespace of the endpoint interface.  If you really must, declare the parameter style BARE and use an xml root " +
    "element from another namespace for the return value.");
  WebMethod otherMethod = implicitElementNames.put(el.getElementName(), webMethod);
  if (otherMethod != null) {
   result.addError(webMethod.getPosition(), "Web method defines a message part named '" + el.getElementName() +
    "' that is identical to the name of a web message part defined in " + otherMethod.getPosition() + ".  Please use annotations to disambiguate.");
result.addError(webMethod.getPosition(), "Enunciate doesn't allow methods to return a web result with a target namespace that is " +
 "declared different from the target namespace of its endpoint interface.  If you really want to, declare the parameter style BARE and use " +
 "an xml root element from another namespace for the return value.");

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

public ValidationResult validateWebMethod(WebMethod webMethod) {
 ValidationResult result = new ValidationResult();
 if (!webMethod.getModifiers().contains(Modifier.PUBLIC)) {
  result.addError(webMethod.getPosition(), "A non-public method cannot be a web method.");
  result.addError(webMethod.getPosition(), "A method marked as excluded cannot be a web method.");
  result.addError(webMethod.getPosition(), "Enunciate doesn't support ENCODED-use web methods.");
  result.addError(webMethod.getPosition(), "A one-way method must have a void return type.");
  result.addError(webMethod.getPosition(), "A one-way method can't throw any exceptions.");
  result.addError(webMethod.getPosition(), "A BARE web method must have a DOCUMENT binding style.");
   result.addError(webMethod.getPosition(), "A one-way method cannot have any 'out' messages (i.e. non-void return values, thrown exceptions, " +
    "out parameters, or in/out parameters).");
     result.addWarning(webMethod.getPosition(), "The header return value that is " + description + " may not (de)serialize " +
      "correctly.  The spec is unclear as to how this should be handled.");
    DecoratedTypeMirror paramType = (DecoratedTypeMirror) ((WebParam) webMessage).getType();
    if (paramType.isArray()) {
     result.addError(webMethod.getPosition(), "A BARE web method must not have an array as a parameter.");
    result.addError(webMethod.getPosition(), "A BARE web method shouldn't have a request wrapper.");
    result.addError(webMethod.getPosition(), "A BARE web method shouldn't have a response wrapper.");
    result.addError(webMethod.getPosition(), "A BARE web method must not have more than one 'in' parameter.");

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

@Override
public ValidationResult validateEndpointInterface(EndpointInterface ei) {
 ValidationResult result = super.validateEndpointInterface(ei);
 if (!isAMFTransient(ei)) {
  for (WebMethod webMethod : ei.getWebMethods()) {
   if (!isAMFTransient(webMethod)) {
    if (!isSupported(webMethod.getWebResult())) {
     result.addError(webMethod.getPosition(), "AMF doesn't support '" + webMethod.getWebResult() + "' as a return type.");
    }
    for (WebParam webParam : webMethod.getWebParameters()) {
     if (!isSupported(webParam.getType())) {
      result.addError(webParam.getPosition(), "AMF doesn't support '" + webParam.getType() + "' as a parameter type.");
     }
    }
   }
  }
  if (ei.getEndpointImplementations().size() > 1) {
   ArrayList<String> impls = new ArrayList<String>();
   for (EndpointImplementation impl : ei.getEndpointImplementations()) {
    impls.add(impl.getQualifiedName());
   }
   result.addError(ei.getPosition(), "Sorry, AMF doesn't support two endpoint implementations for interface '" + ei.getQualifiedName() +
    "'.  Found " + ei.getEndpointImplementations().size() + " implementations (" + impls.toString() + ").");
  }
 }
 
 return result;
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

if (!isGWTTransient(webMethod)) {
 if (!isSupported(webMethod.getWebResult())) {
  result.addError(webMethod.getPosition(), "GWT doesn't support '" + webMethod.getWebResult() + "' as a return type.");

代码示例来源:origin: org.codehaus.enunciate/enunciate-core

/**
 * Gets the xml type of this result.
 *
 * @return The xml type of this result.
 */
public XmlType getXmlType() {
 try {
  XmlType xmlType = XmlTypeFactory.findSpecifiedType(this);
  if (xmlType == null) {
   xmlType = XmlTypeFactory.getXmlType(getType());
  }
  return xmlType;
 }
 catch (XmlTypeException e) {
  throw new ValidationException(method.getPosition(), "Result of method " + getWebMethod().getSimpleName() + " of " + getWebMethod().getDeclaringEndpointInterface().getQualifiedName() + ": " + e.getMessage());
 }
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

result.addError(webMethod.getPosition(), "For some reason, JAXB doesn't support maps in return values or in parameters.  Still need to investigate further the reason....");

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

for (WebMethod webMethod : ei.getWebMethods()) {
 if (!uniquelyNamedWebMethods.add(webMethod)) {
  result.addError(webMethod.getPosition(), "Web methods must have unique operation names.  Use annotations to disambiguate.");

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com