本文整理了Java中org.apache.tuscany.sca.interfacedef.DataType.getLogical()
方法的一些代码示例,展示了DataType.getLogical()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataType.getLogical()
方法的具体详情如下:
包路径:org.apache.tuscany.sca.interfacedef.DataType
类名称:DataType
方法名:getLogical
[英]Returns the logical identifier used by the assembly. The type of this value identifies the logical type system in use. Known values are:
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding
/**
* Find the fault data type behind the exception data type
* @param exceptionType The exception data type
* @return The fault data type
*/
private DataType getFaultType(DataType exceptionType) {
return exceptionType == null ? null : (DataType)exceptionType.getLogical();
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
/**
* Find the fault data type behind the exception data type
* @param exceptionType The exception data type
* @return The fault data type
*/
private DataType getFaultType(DataType exceptionType) {
return exceptionType == null ? null : (DataType)exceptionType.getLogical();
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding-jaxb
public DOMElementXmlAdapter(Mediator mediator, DataType dataType) {
this.mediator = mediator;
this.dataType = dataType;
this.domType = new DataTypeImpl(DOMDataBinding.NAME, Element.class, dataType.getLogical());
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public DOMElementXmlAdapter(Mediator mediator, DataType dataType) {
this.mediator = mediator;
this.dataType = dataType;
this.domType = new DataTypeImpl(DOMDataBinding.NAME, Element.class, dataType.getLogical());
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding
@SuppressWarnings("unchecked")
public Object transform(Object source, TransformationContext context) {
DataType<DataType> sourceType = context.getSourceDataType();
DataType<DataType> targetType = context.getTargetDataType();
return mediator.mediate(source, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
@SuppressWarnings("unchecked")
public Object transform(Object source, TransformationContext context) {
DataType<DataType> sourceType = context.getSourceDataType();
DataType<DataType> targetType = context.getTargetDataType();
return mediator.mediate(source, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
private boolean inputTypesCompatible(DataType wrapperType, DataType<List<DataType>> inputType, Map<String, XMLTypeHelper> helpers) {
XMLTypeHelper wrapperHelper = getTypeHelper(wrapperType, helpers);
for (DataType dt : inputType.getLogical()) {
if (getTypeHelper(dt, helpers) != wrapperHelper) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-ws-wsdlgen
private boolean inputTypesCompatible(DataType wrapperType, DataType<List<DataType>> inputType, Map<String, XMLTypeHelper> helpers) {
XMLTypeHelper wrapperHelper = getTypeHelper(wrapperType, helpers);
for (DataType dt : inputType.getLogical()) {
if (getTypeHelper(dt, helpers) != wrapperHelper) {
return false;
}
}
return true;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
private void setDataBinding(DataType dataType, String dataBinding) {
if ("java:array".equals(dataType.getDataBinding())) {
setDataBinding((DataType)dataType.getLogical(), dataBinding);
} else {
dataType.setDataBinding(dataBinding);
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-assembly
private void setDataBinding(DataType dataType, String dataBinding) {
if ("java:array".equals(dataType.getDataBinding())) {
setDataBinding((DataType)dataType.getLogical(), dataBinding);
} else {
dataType.setDataBinding(dataBinding);
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
@SuppressWarnings("unchecked")
public Throwable transform(Throwable source, TransformationContext context) {
DataType<DataType> sourceType = context.getSourceDataType();
DataType<DataType> targetType = context.getTargetDataType();
Object sourceFaultInfo = faultExceptionMapper.getFaultInfo(source, sourceType.getLogical().getPhysical(), context.getSourceOperation());
Object targetFaultInfo =
mediator.mediate(sourceFaultInfo, sourceType.getLogical(), targetType.getLogical(), context.getMetadata());
Throwable targetException =
faultExceptionMapper.wrapFaultInfo(targetType, source.getMessage(), targetFaultInfo, source.getCause(), context.getTargetOperation());
// FIXME
return targetException == null ? source : targetException;
}
代码示例来源: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-databinding
@SuppressWarnings("unchecked")
public boolean introspect(DataType type, Operation operation) {
assert type != null;
Class cls = type.getPhysical();
if (baseType != null && baseType.isAssignableFrom(cls)) {
type.setDataBinding(getName());
if (type.getLogical() == null) {
type.setLogical(XMLType.UNKNOWN);
}
return true;
}
return false;
}
代码示例来源: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-databinding
public Object transform(T source, TransformationContext context) {
XMLType xmlType = (XMLType)context.getSourceDataType().getLogical();
QName type = (xmlType != null) ? xmlType.getTypeName() : null;
if (type == null) {
xmlType = (XMLType)context.getTargetDataType().getLogical();
type = (xmlType != null) ? xmlType.getTypeName() : null;
}
Object result = mapper.toJavaObject(type, getText(source), context);
close(source);
return result;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public Object transform(T source, TransformationContext context) {
//FIXME why is the logical type sometimes a Class instead of an XMLType?
if (context.getSourceDataType().getLogical() instanceof XMLType) {
XMLType xmlType = (XMLType) context.getSourceDataType().getLogical();
return toJavaObject(xmlType.getTypeName(), getRootElement(source), context);
} else {
return toJavaObject(null, getRootElement(source), context);
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding
public Object transform(T source, TransformationContext context) {
//FIXME why is the logical type sometimes a Class instead of an XMLType?
if (context.getSourceDataType().getLogical() instanceof XMLType) {
XMLType xmlType = (XMLType) context.getSourceDataType().getLogical();
return toJavaObject(xmlType.getTypeName(), getRootElement(source), context);
} else {
return toJavaObject(null, getRootElement(source), context);
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public Object transform(T source, TransformationContext context) {
XMLType xmlType = (XMLType)context.getSourceDataType().getLogical();
QName type = (xmlType != null) ? xmlType.getTypeName() : null;
if (type == null) {
xmlType = (XMLType)context.getTargetDataType().getLogical();
type = (xmlType != null) ? xmlType.getTypeName() : null;
}
Object result = mapper.toJavaObject(type, getText(source), context);
close(source);
return result;
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime
public T transform(Object source, TransformationContext context) {
XMLType xmlType = (XMLType) context.getTargetDataType().getLogical();
String text = mapper.toXMLLiteral(xmlType.getTypeName(), source, context);
return createElement(xmlType.getElementName(), text, context);
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-databinding
public T transform(Object source, TransformationContext context) {
XMLType xmlType = (XMLType) context.getTargetDataType().getLogical();
String text = mapper.toXMLLiteral(xmlType.getTypeName(), source, context);
return createElement(xmlType.getElementName(), text, context);
}
内容来源于网络,如有侵权,请联系作者删除!