1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
1068 Element te = (Element) t.getTarget(); |
1068 Element te = (Element) t.getTarget(); |
1069 elemName = te.getElementName(); |
1069 elemName = te.getElementName(); |
1070 } |
1070 } |
1071 |
1071 |
1072 Collection<TypeInfo> refs = propInfo.ref(); |
1072 Collection<TypeInfo> refs = propInfo.ref(); |
1073 TypeInfo ti; |
1073 if ((refs != null) && (!refs.isEmpty()) && (elemName != null)){ |
1074 if ((refs != null) && (!refs.isEmpty()) && (elemName != null) |
1074 ClassInfoImpl cImpl = null; |
1075 && ((ti = refs.iterator().next()) == null || ti instanceof ClassInfoImpl)) { |
1075 for (TypeInfo ref : refs) { |
1076 ClassInfoImpl cImpl = (ClassInfoImpl)ti; |
1076 if (ref == null || ref instanceof ClassInfoImpl) { |
1077 if ((cImpl != null) && (cImpl.getElementName() != null)) { |
1077 if (elemName.equals(((ClassInfoImpl)ref).getElementName())) { |
|
1078 cImpl = (ClassInfoImpl) ref; |
|
1079 break; |
|
1080 } |
|
1081 } |
|
1082 } |
|
1083 if (cImpl != null) |
1078 e.ref(new QName(cImpl.getElementName().getNamespaceURI(), tn.getLocalPart())); |
1084 e.ref(new QName(cImpl.getElementName().getNamespaceURI(), tn.getLocalPart())); |
1079 } else { |
1085 else |
1080 e.ref(new QName("", tn.getLocalPart())); |
1086 e.ref(new QName("", tn.getLocalPart())); |
1081 } |
1087 } else |
1082 } else { |
|
1083 e.ref(tn); |
1088 e.ref(tn); |
1084 } |
|
1085 } |
1089 } |
1086 } else { |
1090 } else { |
1087 e.name(tn.getLocalPart()); |
1091 e.name(tn.getLocalPart()); |
1088 writeTypeRef(e,t, "type"); |
1092 writeTypeRef(e,t, "type"); |
1089 elementFormDefault.writeForm(e,tn); |
1093 elementFormDefault.writeForm(e,tn); |