use of com.sun.tools.ws.processor.model.java.JavaStructureMember in project metro-jax-ws by eclipse-ee4j.
the class ModelerUtils method isEquivalentLiteralStructures.
/**
* Compares two JAXBStructures.
*
* @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;
}
use of com.sun.tools.ws.processor.model.java.JavaStructureMember in project metro-jax-ws by eclipse-ee4j.
the class ModelerUtils method createUnwrappedParameter.
/**
* @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;
}
Aggregations