Search in sources :

Example 1 with JavaStructureType

use of com.sun.tools.ws.processor.model.java.JavaStructureType in project metro-jax-ws by eclipse-ee4j.

the class ModelerUtils method createUnwrappedParameters.

/**
 * This method uses JAXBStructured type (wrapper style operations) and
 * unwraps it to create list of parameters.
 *
 * @param jaxbType instance of JAXBType, could be JAXBStructured type.
 * @param block The Block (body/Header/Attachment) to which the created Parameter belong.
 * @return list of Parameters
 */
public static List<Parameter> createUnwrappedParameters(JAXBType jaxbType, Block block) {
    List<Parameter> paramList = new ArrayList<>();
    JAXBStructuredType type = null;
    if (!(jaxbType instanceof JAXBStructuredType))
        type = createJAXBStructureType(jaxbType);
    else
        type = (JAXBStructuredType) jaxbType;
    JavaStructureType jst = new JavaStructureType(jaxbType.getJavaType().getRealName(), true, type);
    type.setJavaType(jst);
    block.setType(type);
    List memberList = jaxbType.getWrapperChildren();
    Iterator props = memberList.iterator();
    while (props.hasNext()) {
        JAXBProperty prop = (JAXBProperty) props.next();
        paramList.add(createUnwrappedParameter(prop, jaxbType, block, type, jst));
    }
    return paramList;
}
Also used : ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) Parameter(com.sun.tools.ws.processor.model.Parameter) ArrayList(java.util.ArrayList) List(java.util.List) JavaStructureType(com.sun.tools.ws.processor.model.java.JavaStructureType)

Aggregations

Parameter (com.sun.tools.ws.processor.model.Parameter)1 JavaStructureType (com.sun.tools.ws.processor.model.java.JavaStructureType)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1