@SuppressWarnings("unchecked") public Object transform(Object array, TransformationContext context) { try { if (array == null) { return null; } DataType<DataType> sourceType = context.getSourceDataType(); DataType<DataType> targetType = context.getTargetDataType(); int length = Array.getLength(array); Object targetArray = Array.newInstance(targetType.getPhysical().getComponentType(), length); for (int i = 0; i < length; i++) { Object sourceItem = Array.get(array, i); Object targetItem = mediator.mediate(sourceItem, sourceType.getLogical(), targetType.getLogical(), context .getMetadata()); Array.set(targetArray, i, targetItem); } return targetArray; } catch (Exception e) { throw new TransformationException(e); } }
@SuppressWarnings("unchecked") public Object transform(Object array, TransformationContext context) { try { if (array == null) { return null; } DataType<DataType> sourceType = context.getSourceDataType(); DataType<DataType> targetType = context.getTargetDataType(); int length = Array.getLength(array); Object targetArray = Array.newInstance(targetType.getPhysical().getComponentType(), length); for (int i = 0; i < length; i++) { Object sourceItem = Array.get(array, i); Object targetItem = mediator.mediate(sourceItem, sourceType.getLogical(), targetType.getLogical(), context .getMetadata()); Array.set(targetArray, i, targetItem); } return targetArray; } catch (Exception e) { throw new TransformationException(e); } }
@SuppressWarnings("unchecked") public Map transform(Map sourceMap, TransformationContext context) { try { if (sourceMap == null) { return null; } DataType<DataType> sourceType = context.getSourceDataType(); DataType<DataType> targetType = context.getTargetDataType(); Map targetMap = createMap(targetType.getPhysical()); for (Object sourceItem : sourceMap.entrySet()) { Map.Entry entry = (Map.Entry)sourceItem; Object targetValue = mediator.mediate(entry.getValue(), sourceType.getLogical(), targetType.getLogical(), context .getMetadata()); targetMap.put(entry.getKey(), targetValue); } return targetMap; } catch (Exception e) { throw new TransformationException(e); } }
(NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); return printQName((QName)obj, namespaceContext);
@SuppressWarnings("unchecked") public Map transform(Map sourceMap, TransformationContext context) { try { if (sourceMap == null) { return null; } DataType<DataType> sourceType = context.getSourceDataType(); DataType<DataType> targetType = context.getTargetDataType(); Map targetMap = createMap(targetType.getPhysical()); for (Object sourceItem : sourceMap.entrySet()) { Map.Entry entry = (Map.Entry)sourceItem; Object targetValue = mediator.mediate(entry.getValue(), sourceType.getLogical(), targetType.getLogical(), context .getMetadata()); targetMap.put(entry.getKey(), targetValue); } return targetMap; } catch (Exception e) { throw new TransformationException(e); } }
} else if (type.equals(XSD_QNAME)) { NamespaceContext namespaceContext = (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); return parseQName(value, namespaceContext); } else if (type.equals(XSD_NOTATION)) { NamespaceContext namespaceContext = (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); return parseQName(value, namespaceContext); } else if (type.equals(XSD_YEAR)) {
@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()); }
@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()); }
} else if (type.equals(XSD_QNAME)) { NamespaceContext namespaceContext = (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); return parseQName(value, namespaceContext); } else if (type.equals(XSD_NOTATION)) { NamespaceContext namespaceContext = (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); return parseQName(value, namespaceContext); } else if (type.equals(XSD_YEAR)) {
(NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); return printQName((QName)obj, namespaceContext);
@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; }
@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; }
@SuppressWarnings("unchecked") public Collection transform(Collection sourceCollection, TransformationContext context) { try { if (sourceCollection == null) { return null; } DataType<DataType> sourceType = context.getSourceDataType(); DataType<DataType> targetType = context.getTargetDataType(); Collection targetCollection = createCollection(targetType.getPhysical()); for (Object sourceItem : sourceCollection) { Object targetItem = mediator.mediate(sourceItem, sourceType.getLogical(), targetType.getLogical(), context .getMetadata()); targetCollection.add(targetItem); } return targetCollection; } catch (Exception e) { throw new TransformationException(e); } }
@SuppressWarnings("unchecked") public Collection transform(Collection sourceCollection, TransformationContext context) { try { if (sourceCollection == null) { return null; } DataType<DataType> sourceType = context.getSourceDataType(); DataType<DataType> targetType = context.getTargetDataType(); Collection targetCollection = createCollection(targetType.getPhysical()); for (Object sourceItem : sourceCollection) { Object targetItem = mediator.mediate(sourceItem, sourceType.getLogical(), targetType.getLogical(), context .getMetadata()); targetCollection.add(targetItem); } return targetCollection; } catch (Exception e) { throw new TransformationException(e); } }
.getMetadata()); return new Object[] {targetWrapper}; mediator.mediate(source[i], sourceType.getLogical().get(i), argType, context.getMetadata()); Object targetWrapper = mediator.mediate(sourceWrapper, sourceType.getLogical().get(0), targetWrapperType, context .getMetadata()); target = targetWrapperHandler.getChildren(targetWrapper, targetOp, true).toArray(); return target; target[i] = mediator.mediate(sourceChildren[i], childType, targetType.getLogical().get(i), context .getMetadata()); Object child = mediator.mediate(source[i], sourceType.getLogical().get(i), targetType.getLogical().get(i), context .getMetadata()); newArgs[i] = child;
.getMetadata()); return new Object[] {targetWrapper}; mediator.mediate(source[i], sourceType.getLogical().get(i), argType, context.getMetadata()); Object targetWrapper = mediator.mediate(sourceWrapper, sourceType.getLogical().get(0), targetWrapperType, context .getMetadata()); target = targetWrapperHandler.getChildren(targetWrapper, targetOp, true).toArray(); return target; target[i] = mediator.mediate(sourceChildren[i], childType, targetType.getLogical().get(i), context .getMetadata()); Object child = mediator.mediate(source[i], sourceType.getLogical().get(i), targetType.getLogical().get(i), context .getMetadata()); newArgs[i] = child;
.getMetadata()); return targetWrapper; DataType<XMLType> targetOutputType = wrapper.getUnwrappedType().getLogical().get(i); targetChildren[i] = mediator.mediate(outputs[i], sourceType.getLogical().get(i), targetOutputType, context.getMetadata()); Object targetWrapper = mediator.mediate(sourceWrapper, sourceType.getLogical().get(0), targetWrapperType, context .getMetadata()); List targetChildren = targetWrapperHandler.getChildren(targetWrapper, targetOp, false); if (targetOp.hasArrayWrappedOutput()) { target[i] = mediator.mediate(sourceChildren[i], childType, targetType.getLogical().get(i), context .getMetadata()); Object child = mediator.mediate(outputs[i], sourceType.getLogical().get(i), targetType.getLogical().get(i), context .getMetadata()); target[i] = child;
.getMetadata()); return targetWrapper; DataType<XMLType> targetOutputType = wrapper.getUnwrappedType().getLogical().get(i); targetChildren[i] = mediator.mediate(outputs[i], sourceType.getLogical().get(i), targetOutputType, context.getMetadata()); Object targetWrapper = mediator.mediate(sourceWrapper, sourceType.getLogical().get(0), targetWrapperType, context .getMetadata()); List targetChildren = targetWrapperHandler.getChildren(targetWrapper, targetOp, false); if (targetOp.hasArrayWrappedOutput()) { target[i] = mediator.mediate(sourceChildren[i], childType, targetType.getLogical().get(i), context .getMetadata()); Object child = mediator.mediate(outputs[i], sourceType.getLogical().get(i), targetType.getLogical().get(i), context .getMetadata()); target[i] = child;