private Annotation[] getMethodParameterAnnotations(final MessagePartInfo mpi) { Annotation[] a = (Annotation[])mpi.getProperty(ReflectionServiceFactoryBean.PARAM_ANNOTATION); if (a != null) { return a; } Annotation[][] paramAnno = (Annotation[][])mpi .getProperty(ReflectionServiceFactoryBean.METHOD_PARAM_ANNOTATIONS); int index = mpi.getIndex(); if (paramAnno != null && index < paramAnno.length && index >= 0) { return paramAnno[index]; } return null; }
public Long getWrapperPartMinOccurs(MessagePartInfo mpi) { Annotation[] a = (Annotation[])mpi.getProperty(ReflectionServiceFactoryBean.PARAM_ANNOTATION); if (a != null) { for (Annotation a2 : a) { if (a2 instanceof XmlElement) { XmlElement e = (XmlElement)a2; if (e.required()) { return 1L; } } } } return null; }
public Boolean isWrapperPartQualified(MessagePartInfo mpi) { Annotation[] annotations = (Annotation[])mpi.getProperty("parameter.annotations"); if (annotations != null) { for (Annotation an : annotations) { String tns = null; if (an instanceof WebParam) { tns = ((WebParam)an).targetNamespace(); } else if (an instanceof WebResult) { tns = ((WebResult)an).targetNamespace(); } if (tns != null && !StringUtils.isEmpty(tns)) { return Boolean.TRUE; } } } return null; }
private synchronized WrapperHelper getWrapperHelper(Message message, MessageInfo messageInfo, MessageInfo wrappedMessageInfo, Class<?> wrapClass, MessagePartInfo messagePartInfo) { WrapperHelper helper = messagePartInfo.getProperty("WRAPPER_CLASS", WrapperHelper.class); if (helper == null) { Service service = ServiceModelUtil.getService(message.getExchange()); DataBinding dataBinding = service.getDataBinding(); if (dataBinding instanceof WrapperCapableDatabinding) { helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding, messageInfo, wrappedMessageInfo, wrapClass); messagePartInfo.setProperty("WRAPPER_CLASS", helper); } } return helper; }
if (Boolean.TRUE.equals(p.getProperty(ReflectionServiceFactoryBean.HEADER))) { if (p.getTypeClass() != null) { int idx = p.getIndex();
String ct = (String) mpi.getProperty(Message.CONTENT_TYPE);
WrapperHelper helper = wrapperPart.getProperty("WRAPPER_CLASS", WrapperHelper.class); if (helper == null) { Service service = ServiceModelUtil.getService(message.getExchange()); int count = 0; for (MessagePartInfo part : messageInfo.getMessageParts()) { if (Boolean.TRUE.equals(part.getProperty(ReflectionServiceFactoryBean.HEADER))) { MessagePartInfo mpi = null; for (MessagePartInfo mpi2 : wrappedMessageInfo.getMessageParts()) {
private void generateMessagePart(ClassWriter cw, MessagePartInfo mpi, Method method, String className) { if (Boolean.TRUE.equals(mpi.getProperty(ReflectionServiceFactoryBean.HEADER))) { return; String name = mpi.getName().getLocalPart(); Class<?> clz = mpi.getTypeClass(); Object obj = mpi.getProperty(ReflectionServiceFactoryBean.RAW_CLASS); if (obj != null) { clz = (Class<?>)obj; Type genericType = (Type)mpi.getProperty(ReflectionServiceFactoryBean.GENERIC_TYPE); if (genericType instanceof ParameterizedType) { ParameterizedType tp = (ParameterizedType)genericType;
private boolean isOutOfBandHeader(final MessagePartInfo part) { if (part == null) { return false; } return Boolean.TRUE.equals(part.getProperty(OUT_OF_BAND_HEADER)); }
private static List<Object> createList(MessagePartInfo part) { Type genericType = (Type)part.getProperty("generic.type"); return createList(genericType); } private static List<Object> createList(Type genericType) {
private Annotation[] getMethodParameterAnnotations(final MessagePartInfo mpi) { Annotation[][] paramAnno = (Annotation[][])mpi.getProperty(METHOD_PARAM_ANNOTATIONS); int index = mpi.getIndex(); if (paramAnno != null && index < paramAnno.length && index >= 0) { return paramAnno[index]; } return null; }
private Annotation[] getMethodParameterAnnotations(final MessagePartInfo mpi) { Annotation[][] paramAnno = (Annotation[][])mpi.getProperty(METHOD_PARAM_ANNOTATIONS); int index = mpi.getIndex(); if (paramAnno != null && index < paramAnno.length && index >= 0) { return paramAnno[index]; } return null; }
private Annotation[] getMethodParameterAnnotations(final MessagePartInfo mpi) { Annotation[][] paramAnno = (Annotation[][])mpi.getProperty(METHOD_PARAM_ANNOTATIONS); int index = mpi.getIndex(); if (paramAnno != null && index < paramAnno.length && index >= 0) { return paramAnno[index]; } return null; }
public Long getWrapperPartMinOccurs(MessagePartInfo mpi) { String miString = (String)mpi.getProperty("minOccurs"); if (miString != null) { return Long.valueOf(miString, 10); } // If no explicit spec and not a primitive type (i.e. mappable to null) // set to 0. if (mpi.getTypeClass() != null && !mpi.getTypeClass().isPrimitive()) { return Long.valueOf(0); } return null; } }
MessagePartInfo firstMessagePart = wrappedMsgInfo.getFirstMessagePart(); MessageContentsList objs = MessageContentsList.getContentsList(message); WrapperHelper helper = firstMessagePart.getProperty("WRAPPER_CLASS", WrapperHelper.class); if (helper == null) { helper = getWrapperHelper(message, messageInfo, wrappedMsgInfo, wrapped, firstMessagePart); if (Boolean.TRUE.equals(p.getProperty(ReflectionServiceFactoryBean.HEADER))) { MessagePartInfo mpi = wrappedMsgInfo.getMessagePart(p.getName()); if (objs.hasValue(p)) {
protected Annotation[] getJAXBAnnotation(MessagePartInfo mpi) { List<Annotation> annoList = null; if (mpi != null) { annoList = extractJAXBAnnotations((Annotation[])mpi.getProperty("parameter.annotations")); if (annoList == null) { annoList = extractJAXBAnnotations(getReturnMethodAnnotations(mpi)); } } return annoList == null ? new Annotation[0] : annoList.toArray(new Annotation[0]); }
private boolean isRefElement(MessagePartInfo outputPart, QName outElement) { OperationInfo wrappedOp = outputPart.getMessageInfo().getOperation().getUnwrappedOperation(); MessagePartInfo mpart = wrappedOp.getOutput().getMessagePart(outElement); if (mpart == null) { return false; } return mpart.getProperty("isRefElement") != null; } }
public Object read(MessagePartInfo part, XMLStreamReader input) { try { AegisType type = part.getProperty("org.apache.cxf.aegis.outerType", AegisType.class); if (type == null) { type = databinding.getType(part); return reader.read(input, type); } ArrayType arrayType = (ArrayType) type; return reader.readFlatArray(input, arrayType, part.getConcreteName()); } catch (Exception e) { throw new Fault(e); } }
@Override public void setOperationInfo(final OperationInfo op) { super.setOperationInfo(op); MessagePartInfo mpi = op.getOutput().getFirstMessagePart(); setName(mpi.getElementQName()); setClassName((String)mpi.getProperty("RESPONSE.WRAPPER.CLASSNAME")); }
@Override public void setOperationInfo(final OperationInfo op) { super.setOperationInfo(op); MessagePartInfo mpi = op.getInput().getFirstMessagePart(); setName(mpi.getElementQName()); setClassName((String)mpi.getProperty("REQUEST.WRAPPER.CLASSNAME")); }