< prev index next >
src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeRef.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 66,76 ****
private final boolean nillable;
public final XmlString defaultValue;
public CTypeRef(CNonElement type, XSElementDecl decl) {
this(type, BGMBuilder.getName(decl),getSimpleTypeName(decl), decl.isNillable(), decl.getDefaultValue() );
-
}
public QName getTypeName() {
return typeName;
}
--- 66,75 ----
*** 98,111 ****
* @param declType given type
* @return simpleTypeName or null
*/
private static QName resolveSimpleTypeName(XSType declType) {
QName name = BGMBuilder.getName(declType);
! if (name != null && !XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(name.getNamespaceURI()))
! return resolveSimpleTypeName(declType.getBaseType());
! else
! return name;
}
public CTypeRef(CNonElement type, QName elementName, QName typeName, boolean nillable, XmlString defaultValue) {
assert type!=null;
assert elementName!=null;
--- 97,115 ----
* @param declType given type
* @return simpleTypeName or null
*/
private static QName resolveSimpleTypeName(XSType declType) {
QName name = BGMBuilder.getName(declType);
! QName result = null;
! if (name != null && !XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(name.getNamespaceURI())) {
! result = resolveSimpleTypeName(declType.getBaseType());
! } else {
! if ( !"anySimpleType".equals(declType.getName()) ) {
! result = name;
! }
! }
! return result;
}
public CTypeRef(CNonElement type, QName elementName, QName typeName, boolean nillable, XmlString defaultValue) {
assert type!=null;
assert elementName!=null;
< prev index next >