}
if (faultString == null) {
throw new IllegalArgumentException("Argument for 'faultstring' may not be null");
}
XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
Fault faultObj = (Fault) builderFactory.getBuilder(Fault.DEFAULT_ELEMENT_NAME)
.buildObject(Fault.DEFAULT_ELEMENT_NAME);
FaultCode faultCodeObj = (FaultCode) builderFactory.getBuilder(FaultCode.DEFAULT_ELEMENT_NAME)
.buildObject(FaultCode.DEFAULT_ELEMENT_NAME);
FaultString faultStringObj = (FaultString) builderFactory.getBuilder(FaultString.DEFAULT_ELEMENT_NAME)
.buildObject(FaultString.DEFAULT_ELEMENT_NAME);
faultCodeObj.setValue(faultCode);
faultObj.setCode(faultCodeObj);
faultStringObj.setValue(faultString);
faultObj.setMessage(faultStringObj);
if (faultActor != null) {
FaultActor faultActorObj = (FaultActor) builderFactory.getBuilder(FaultActor.DEFAULT_ELEMENT_NAME)
.buildObject(FaultActor.DEFAULT_ELEMENT_NAME);
faultActorObj.setValue(faultActor);
faultObj.setActor(faultActorObj);
}
Detail detailObj = null;
if (detailChildren != null && !detailChildren.isEmpty()) {
detailObj = (Detail) builderFactory.getBuilder(Detail.DEFAULT_ELEMENT_NAME)
.buildObject(Detail.DEFAULT_ELEMENT_NAME);
for (XMLObject xo : detailChildren) {
if (xo != null) {
detailObj.getUnknownXMLObjects().add(xo);
}
}
}
if (detailAttributes != null && !detailAttributes.isEmpty()) {
if (detailObj == null) {
detailObj = (Detail) builderFactory.getBuilder(Detail.DEFAULT_ELEMENT_NAME)
.buildObject(Detail.DEFAULT_ELEMENT_NAME);
}
for (Entry<QName,String> entry : detailAttributes.entrySet()) {
if (entry.getKey() != null && entry.getValue() != null) {
detailObj.getUnknownAttributes().put(entry.getKey(), entry.getValue());