本文整理了Java中org.apache.tuscany.sca.interfacedef.util.XMLType.<init>()
方法的一些代码示例,展示了XMLType.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLType.<init>()
方法的具体详情如下:
包路径:org.apache.tuscany.sca.interfacedef.util.XMLType
类名称:XMLType
方法名:<init>
暂无
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public static XMLType getType(QName type) {
return new XMLType(null, type);
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly
public static XMLType getType(QName type) {
return new XMLType(null, type);
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public GeneratedDataTypeImpl(XMLAdapterExtensionPoint xmlAdapters,
Method m,
String wrapperClassName,
String wrapperNamespace,
String wrapperName,
boolean request,
GeneratedClassLoader cl) {
super();
this.method = m;
this.wrapperClassName = wrapperClassName;
this.wrapperNamespace = wrapperNamespace;
this.wrapperName = wrapperName;
this.classLoader = cl;
this.request = request;
QName name = new QName(wrapperNamespace, wrapperName);
this.logical = new XMLType(name, name);
this.xmlAdapters = xmlAdapters;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly
private DataType getDataType(ElementInfo element) {
DataType type = null;
if (element.isMany()) {
DataType logical = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
type = new DataTypeImpl<DataType>("java:array", Object[].class, logical);
} else {
type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
}
return type;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
private DataType getDataType(ElementInfo element) {
DataType type = null;
if (element.isMany()) {
DataType logical = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
type = new DataTypeImpl<DataType>("java:array", Object[].class, logical);
} else {
type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
}
return type;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public GeneratedDataTypeImpl(XMLAdapterExtensionPoint xmlAdapters,
Class<? extends Throwable> exceptionClass,
GeneratedClassLoader cl,
Operation operation) {
super();
this.exceptionClass = exceptionClass;
this.classLoader = cl;
QName name = FaultBeanGenerator.getElementName(exceptionClass, operation);
this.logical = new XMLType(name, name);
this.xmlAdapters = xmlAdapters;
this.operation = operation;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public DataType<XMLType> run() {
try {
Class<?> faultBean = Class.forName(faultBeanClassName, false, cls.getClassLoader());
return new DataTypeImpl<XMLType>(faultBean, new XMLType(qname, qname));
} catch (ClassNotFoundException e) {
if (generatingFaultBean) {
Class<? extends Throwable> t = (Class<? extends Throwable>)cls;
ClassLoader parent =
operation == null ? t.getClassLoader() : ((JavaInterface)operation.getInterface())
.getJavaClass().getClassLoader();
GeneratedClassLoader cl = new GeneratedClassLoader(parent);
GeneratedDataTypeImpl dt = new GeneratedDataTypeImpl(xmlAdapterExtensionPoint, t, cl, operation);
return dt;
} else {
return new DataTypeImpl<XMLType>(cls, new XMLType(qname, qname));
}
}
}
});
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
/**
* @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
*/
public DataType getWrapperType(Operation operation, boolean input) {
WrapperInfo inputWrapperInfo = operation.getInputWrapper();
WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
ElementInfo element = input? inputWrapperInfo.getWrapperElement(): outputWrapperInfo.getWrapperElement();
DataType<XMLType> wrapperType =
new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class, new XMLType(element));
return wrapperType;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding-axiom
/**
* @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
*/
public DataType getWrapperType(Operation operation, boolean input) {
WrapperInfo inputWrapperInfo = operation.getInputWrapper();
WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
ElementInfo element = input ? inputWrapperInfo.getWrapperElement() : outputWrapperInfo.getWrapperElement();
DataType<XMLType> wrapperType =
new DataTypeImpl<XMLType>(AxiomDataBinding.NAME, OMElement.class, new XMLType(element));
return wrapperType;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding
/**
* @see org.apache.tuscany.sca.databinding.WrapperHandler#getWrapperType(Operation, boolean)
*/
public DataType getWrapperType(Operation operation, boolean input) {
WrapperInfo inputWrapperInfo = operation.getInputWrapper();
WrapperInfo outputWrapperInfo = operation.getOutputWrapper();
ElementInfo element = input? inputWrapperInfo.getWrapperElement(): outputWrapperInfo.getWrapperElement();
DataType<XMLType> wrapperType =
new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class, new XMLType(element));
return wrapperType;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding
@Override
public boolean introspect(DataType type, Operation operation) {
if (Node.class.isAssignableFrom(type.getPhysical())) {
if (type.getLogical() == null) {
type.setLogical(new XMLType(ROOT_ELEMENT, null));
}
type.setDataBinding(NAME);
return true;
}
return false;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public DataType<XMLType> run() {
try {
Class<?> wrapperClass = Class.forName(inputWrapperClassName, false, clazz.getClassLoader());
QName qname = new QName(inputNS, inputName);
DataType dt = new DataTypeImpl<XMLType>(wrapperClass, new XMLType(qname, qname));
dataBindingExtensionPoint.introspectType(dt, operation);
// TUSCANY-2505
if (dt.getLogical() instanceof XMLType) {
XMLType xmlType = (XMLType)dt.getLogical();
xmlType.setElementName(qname);
}
return dt;
} catch (ClassNotFoundException e) {
GeneratedClassLoader cl = new GeneratedClassLoader(clazz.getClassLoader());
return new GeneratedDataTypeImpl(xmlAdapterExtensionPoint, method, inputWrapperClassName, inputNS, inputName, true,
cl);
}
}
});
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
@Override
public boolean introspect(DataType type, Operation operation) {
if (Node.class.isAssignableFrom(type.getPhysical())) {
if (type.getLogical() == null) {
type.setLogical(new XMLType(ROOT_ELEMENT, null));
}
type.setDataBinding(NAME);
return true;
}
return false;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-rest-runtime
protected void introspectAnnotations(Annotation[] annotations, DataType targetDataType) {
WebResult result = getAnnotation(annotations, WebResult.class);
if (result != null) {
QName name = new QName(result.targetNamespace(), result.name());
targetDataType.setLogical(new XMLType(name, null));
}
WebParam param = getAnnotation(annotations, WebParam.class);
if (param != null) {
QName name = new QName(param.targetNamespace(), param.name());
targetDataType.setLogical(new XMLType(name, null));
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public DataType<XMLType> run() {
try {
Class<?> wrapperClass =
Class.forName(outputWrapperClassName, false, clazz.getClassLoader());
QName qname = new QName(outputNS, outputName);
DataType dt = new DataTypeImpl<XMLType>(wrapperClass, new XMLType(qname, qname));
dataBindingExtensionPoint.introspectType(dt, operation);
// TUSCANY-2505
if (dt.getLogical() instanceof XMLType) {
XMLType xmlType = (XMLType)dt.getLogical();
xmlType.setElementName(qname);
}
return dt;
} catch (ClassNotFoundException e) {
GeneratedClassLoader cl = new GeneratedClassLoader(clazz.getClassLoader());
return new GeneratedDataTypeImpl(xmlAdapterExtensionPoint, method, outputWrapperClassName, outputNS, outputName,
false, cl);
}
}
});
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
@Override
public boolean introspect(DataType type, Operation operation) {
Class<?> cls = type.getPhysical();
if (cls == Object.class) {
return false;
}
// HACK: [rfeng] By pass the one know to XMLString
String db = type.getDataBinding();
if (db != null && (XMLStringDataBinding.NAME.equals(db))) {
return false;
}
if (SimpleTypeMapperImpl.JAVA2XML.keySet().contains(cls)) {
type.setDataBinding(NAME);
QName elementName = null;
Object logical = type.getLogical();
if (logical instanceof XMLType) {
elementName = ((XMLType)logical).getElementName();
}
TypeInfo typeInfo = simpleTypeMapper.getXMLType(cls);
type.setLogical(new XMLType(elementName, typeInfo == null ? null : typeInfo.getQName()));
return true;
} else {
return false;
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding
@Override
public boolean introspect(DataType type, Operation operation) {
Class<?> cls = type.getPhysical();
if (cls == Object.class) {
return false;
}
// HACK: [rfeng] By pass the one know to XMLString
String db = type.getDataBinding();
if (db != null && (XMLStringDataBinding.NAME.equals(db))) {
return false;
}
if (SimpleTypeMapperImpl.JAVA2XML.keySet().contains(cls)) {
type.setDataBinding(NAME);
QName elementName = null;
Object logical = type.getLogical();
if (logical instanceof XMLType) {
elementName = ((XMLType)logical).getElementName();
}
TypeInfo typeInfo = simpleTypeMapper.getXMLType(cls);
type.setLogical(new XMLType(elementName, typeInfo == null ? null : typeInfo.getQName()));
return true;
} else {
return false;
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
sourceDataType =
new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class,
new XMLType(null, this.property.getXSDType()));
XMLType xmlType = new XMLType(typeInfo);
代码示例来源:origin: org.apache.tuscany.sca/tuscany-interface-wsdl
public WSDLPart(Part part, Class javaType) throws InvalidWSDLException {
this.part = part;
QName elementName = part.getElementName();
if (elementName != null) {
element = WSDLOperationIntrospectorImpl.this.getElement(elementName);
if (element == null) {
throw new InvalidWSDLException("Element cannot be resolved: " + elementName.toString());
}
} else {
// Create an faked XSD element to host the metadata
element = new XmlSchemaElement();
element.setName(part.getName());
element.setQName(new QName(null, part.getName()));
QName typeName = part.getTypeName();
if (typeName != null) {
XmlSchemaType type = WSDLOperationIntrospectorImpl.this.getType(typeName);
if (type == null) {
throw new InvalidWSDLException("Type cannot be resolved: " + typeName.toString());
}
element.setSchemaType(type);
element.setSchemaTypeName(type.getQName());
}
}
XMLType xmlType = new XMLType(getElementInfo(element));
xmlType.setNillable(element.isNillable());
xmlType.setMany(element.getMaxOccurs() > 1);
dataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public WSDLPart(Part part, Class javaType) throws InvalidWSDLException {
this.part = part;
QName elementName = part.getElementName();
if (elementName != null) {
element = WSDLOperationIntrospectorImpl.this.getElement(elementName);
if (element == null) {
throw new InvalidWSDLException("Element cannot be resolved: " + elementName.toString());
}
} else {
// Create an faked XSD element to host the metadata
element = new XmlSchemaElement();
element.setName(part.getName());
element.setQName(new QName(null, part.getName()));
QName typeName = part.getTypeName();
if (typeName != null) {
XmlSchemaType type = WSDLOperationIntrospectorImpl.this.getType(typeName);
if (type == null) {
throw new InvalidWSDLException("Type cannot be resolved: " + typeName.toString());
}
element.setSchemaType(type);
element.setSchemaTypeName(type.getQName());
}
}
XMLType xmlType = new XMLType(getElementInfo(element));
xmlType.setNillable(element.isNillable());
xmlType.setMany(element.getMaxOccurs() > 1);
dataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
}
内容来源于网络,如有侵权,请联系作者删除!