本文整理了Java中org.codehaus.enunciate.contract.jaxws.WebFault.getPosition()
方法的一些代码示例,展示了WebFault.getPosition()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebFault.getPosition()
方法的具体详情如下:
包路径:org.codehaus.enunciate.contract.jaxws.WebFault
类名称:WebFault
方法名:getPosition
暂无
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
/**
* Calculates a namespace URI for a given package. Default implementation uses the algorithm defined in
* section 3.2 of the jax-ws spec.
*
* @return The calculated namespace uri.
*/
protected String calculateNamespaceURI() {
PackageDeclaration pkg = getPackage();
if ((pkg == null) || ("".equals(pkg.getQualifiedName()))) {
throw new ValidationException(getPosition(), "A web service in no package must specify a target namespace.");
}
String[] tokens = pkg.getQualifiedName().split("\\.");
String uri = "http://";
for (int i = tokens.length - 1; i >= 0; i--) {
uri += tokens[i];
if (i != 0) {
uri += ".";
}
}
uri += "/";
return uri;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
/**
* Calculates a namespace URI for a given package. Default implementation uses the algorithm defined in
* section 3.2 of the jax-ws spec.
*
* @return The calculated namespace uri.
*/
protected String calculateNamespaceURI() {
PackageDeclaration pkg = getPackage();
if ((pkg == null) || ("".equals(pkg.getQualifiedName()))) {
throw new ValidationException(getPosition(), getQualifiedName() + ": a web fault in no package must specify a target namespace.");
}
String[] tokens = pkg.getQualifiedName().split("\\.");
String uri = "http://";
for (int i = tokens.length - 1; i >= 0; i--) {
uri += tokens[i];
if (i != 0) {
uri += ".";
}
}
uri += "/";
return uri;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
/**
* Validates a web fault.
*
* @param webFault The web fault to validate.
* @param alreadyVisited The bean names that have alrady been visited.
* @return The validation result.
*/
public ValidationResult validateWebFault(WebFault webFault, Set<String> alreadyVisited) {
AnnotationProcessorEnvironment ape = Context.getCurrentEnvironment();
ValidationResult result = new ValidationResult();
if (webFault.isImplicitSchemaElement()) {
String faultBeanFQN = webFault.getImplicitFaultBeanQualifiedName();
if (!alreadyVisited.add(faultBeanFQN)) {
result.addError(webFault.getPosition(), faultBeanFQN + " conflicts with another generated bean name. Please use the @WebFault annotation " +
"to customize the fault bean name.");
}
else if (ape.getTypeDeclaration(faultBeanFQN) != null) {
result.addError(webFault.getPosition(), faultBeanFQN + " is an existing class. Either move it, or customize the fault bean name with the " +
"@WebFault annotation.");
}
}
return result;
}
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
public int compare(ImplicitChildElement o1, ImplicitChildElement o2) {
int index1 = -1;
int index2 = -1;
for (int i = 0; i < propOrder.value().length; i++) {
String prop = propOrder.value()[i];
if (o1.getElementName().equals(prop)) {
index1 = i;
}
if (o2.getElementName().equals(prop)) {
index2 = i;
}
}
if (index1 < 0) {
throw new ValidationException(WebFault.this.getPosition(), WebFault.this.getQualifiedName() + ": @WebFaultPropertyOrder doesn't specify a property '" + o1.getElementName() + "'.");
}
else if (index2 < 0) {
throw new ValidationException(WebFault.this.getPosition(), WebFault.this.getQualifiedName() + ": @WebFaultPropertyOrder doesn't specify a property '" + o2.getElementName() + "'.");
}
else {
return index1 - index2;
}
}
});
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
throw new ValidationException(getPosition(), "The faultInfo bean for a web fault must be a root element. " + explicitFaultClass.getQualifiedName()
+ " must be annotated with @XmlRootElement.");
代码示例来源:origin: org.codehaus.enunciate/enunciate-full
if (!isGWTTransient(fault)) {
if ((this.enforceNamespaceConformance) && (!fault.getPackage().getQualifiedName().startsWith(this.gwtModuleNamespace))) {
result.addError(fault.getPosition(), String.format("The package of the fault, %s, must start with the GWT module namespace, %s.", fault.getPackage().getQualifiedName(), gwtModuleNamespace));
代码示例来源:origin: org.codehaus.enunciate/enunciate-core
ClassType faultInfoType = (ClassType) faultInfoProperty.getPropertyType();
if (faultInfoType.getDeclaration() == null) {
throw new ValidationException(getPosition(), getQualifiedName() + ": class not found: " + faultInfoType + ".");
代码示例来源:origin: org.codehaus.enunciate/enunciate-java-client
for (WebFault webFault : allFaults.values()) {
if (useServerSide(webFault, matcher)) {
SourcePosition position = webFault.getPosition();
if (position == null || position.file() == null) {
throw new IllegalStateException("Unable to find source file for " + webFault.getQualifiedName());
内容来源于网络,如有侵权,请联系作者删除!