com.sun.tools.internal.ws.processor.model.java.JavaStructureType Java Examples

The following examples show how to use com.sun.tools.internal.ws.processor.model.java.JavaStructureType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModelerUtils.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #2
Source File: ModelerUtils.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #3
Source File: ModelerUtils.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #4
Source File: ModelerUtils.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #5
Source File: ModelerUtils.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #6
Source File: ModelerUtils.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #7
Source File: ModelerUtils.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #8
Source File: ModelerUtils.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #9
Source File: ModelerUtils.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #10
Source File: ModelerUtils.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #11
Source File: ModelerUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #12
Source File: ModelerUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #13
Source File: ModelerUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #14
Source File: ModelerUtils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #15
Source File: ModelerUtils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #16
Source File: ModelerUtils.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #17
Source File: ModelerUtils.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #18
Source File: ModelerUtils.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #19
Source File: ModelerUtils.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #20
Source File: ModelerUtils.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #21
Source File: ModelerUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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<Parameter>();
    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;
}
 
Example #22
Source File: ModelerUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #23
Source File: ModelerUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Compares two JAXBStructures.
 *
 * @param struct1
 * @param struct2
 * @return true if struct1 and struct2 are equivalent.
 */
public static boolean isEquivalentLiteralStructures(
    JAXBStructuredType struct1,
    JAXBStructuredType struct2) {
    if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
        return false;
    Iterator members = struct1.getElementMembers();
    JAXBElementMember member1;
    JavaStructureMember javaMember1, javaMember2;
    for (int i = 0; members.hasNext(); i++) {
        member1 = (JAXBElementMember)members.next();
        javaMember1 = member1.getJavaStructureMember();
        javaMember2 =
            ((JavaStructureType)struct2.getJavaType()).getMemberByName(
                member1.getJavaStructureMember().getName());
        if (javaMember2.getConstructorPos() != i
            || !javaMember1.getType().equals(javaMember2.getType())) {
            return false;
        }
    }
    return false;
}
 
Example #24
Source File: ModelerUtils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param prop
 * @param jaxbType
 * @param block
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop,
        JAXBType jaxbType, Block block, JAXBStructuredType type,
        JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName
            .getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType
            .getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
 
Example #25
Source File: JAXBStructuredType.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public JAXBStructuredType(QName name, JavaStructureType javaType) {
    super(name, javaType);
}
 
Example #26
Source File: JAXBStructuredType.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public JAXBStructuredType(QName name, JavaStructureType javaType) {
    super(name, javaType);
}
 
Example #27
Source File: JAXBStructuredType.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public JAXBStructuredType(QName name, JavaStructureType javaType) {
    super(name, javaType);
}
 
Example #28
Source File: JAXBStructuredType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public JAXBStructuredType(QName name, JavaStructureType javaType) {
    super(name, javaType);
}
 
Example #29
Source File: JAXBStructuredType.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public JAXBStructuredType(QName name, JavaStructureType javaType) {
    super(name, javaType);
}
 
Example #30
Source File: JAXBStructuredType.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public JAXBStructuredType(QName name, JavaStructureType javaType) {
    super(name, javaType);
}