下面列出了javax.xml.bind.annotation.XmlMixed#com.sun.xml.internal.bind.v2.TODO 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public Class parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
String name = WhiteSpaceProcessor.trim(text).toString();
ClassLoader cl = UnmarshallingContext.getInstance().classLoader;
if(cl==null)
cl = Thread.currentThread().getContextClassLoader();
if(cl!=null)
return cl.loadClass(name);
else
return Class.forName(name);
} catch (ClassNotFoundException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
/**
* Computes the type name of the array from that of the item type.
*/
public static QName calcArrayTypeName(QName n) {
String uri;
if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
TODO.checkSpec("this URI");
uri = "http://jaxb.dev.java.net/array";
} else
uri = n.getNamespaceURI();
return new QName(uri,n.getLocalPart()+"Array");
}
public URL parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return new URL(WhiteSpaceProcessor.trim(text).toString());
} catch (MalformedURLException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public UUID parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return UUID.fromString(WhiteSpaceProcessor.trim(text).toString());
} catch (IllegalArgumentException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
private QName calcXmlName(String uri,String local) {
// compute the default
TODO.checkSpec();
if(local.length()==0 || local.equals("##default"))
local = seed.getName();
if(uri.equals("##default")) {
XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
// JAX-RPC doesn't want the default namespace URI swapping to take effect to
// local "unqualified" elements. UGLY.
if(xs!=null) {
switch(xs.elementFormDefault()) {
case QUALIFIED:
QName typeName = parent.getTypeName();
if(typeName!=null)
uri = typeName.getNamespaceURI();
else
uri = xs.namespace();
if(uri.length()==0)
uri = parent.builder.defaultNsUri;
break;
case UNQUALIFIED:
case UNSET:
uri = "";
}
} else {
uri = "";
}
}
return new QName(uri.intern(),local.intern());
}
public void wildcard(XSWildcard xsWildcard) {
// TODO: implement this method later
// I guess we might allow this to be mapped to a generic element property ---
// not sure exactly how do we do it.
TODO.checkSpec();
throw new UnsupportedOperationException();
}
public static TypeUse makeCollection( TypeUse t ) {
if(t.isCollection()) return t;
CAdapter au = t.getAdapterUse();
if(au!=null && !au.isWhitespaceAdapter()) {
// we can't process this right now.
// for now bind to a weaker type
TODO.checkSpec();
return CBuiltinLeafInfo.STRING_LIST;
}
return new TypeUseImpl( t.getInfo(), true, t.idUse(), t.getExpectedMimeType(), null );
}
/**
* Computes the type name of the array from that of the item type.
*/
public static QName calcArrayTypeName(QName n) {
String uri;
if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
TODO.checkSpec("this URI");
uri = "http://jaxb.dev.java.net/array";
} else
uri = n.getNamespaceURI();
return new QName(uri,n.getLocalPart()+"Array");
}
public URL parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return new URL(WhiteSpaceProcessor.trim(text).toString());
} catch (MalformedURLException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public UUID parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return UUID.fromString(WhiteSpaceProcessor.trim(text).toString());
} catch (IllegalArgumentException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
private QName calcXmlName(String uri,String local) {
// compute the default
TODO.checkSpec();
if(local.length()==0 || local.equals("##default"))
local = seed.getName();
if(uri.equals("##default")) {
XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
// JAX-RPC doesn't want the default namespace URI swapping to take effect to
// local "unqualified" elements. UGLY.
if(xs!=null) {
switch(xs.elementFormDefault()) {
case QUALIFIED:
QName typeName = parent.getTypeName();
if(typeName!=null)
uri = typeName.getNamespaceURI();
else
uri = xs.namespace();
if(uri.length()==0)
uri = parent.builder.defaultNsUri;
break;
case UNQUALIFIED:
case UNSET:
uri = "";
}
} else {
uri = "";
}
}
return new QName(uri.intern(),local.intern());
}
public void wildcard(XSWildcard xsWildcard) {
// TODO: implement this method later
// I guess we might allow this to be mapped to a generic element property ---
// not sure exactly how do we do it.
TODO.checkSpec();
throw new UnsupportedOperationException();
}
public static TypeUse makeCollection( TypeUse t ) {
if(t.isCollection()) return t;
CAdapter au = t.getAdapterUse();
if(au!=null && !au.isWhitespaceAdapter()) {
// we can't process this right now.
// for now bind to a weaker type
TODO.checkSpec();
return CBuiltinLeafInfo.STRING_LIST;
}
return new TypeUseImpl( t.getInfo(), true, t.idUse(), t.getExpectedMimeType(), null );
}
/**
* Computes the type name of the array from that of the item type.
*/
public static QName calcArrayTypeName(QName n) {
String uri;
if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
TODO.checkSpec("this URI");
uri = "http://jaxb.dev.java.net/array";
} else
uri = n.getNamespaceURI();
return new QName(uri,n.getLocalPart()+"Array");
}
public URL parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return new URL(WhiteSpaceProcessor.trim(text).toString());
} catch (MalformedURLException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public UUID parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return UUID.fromString(WhiteSpaceProcessor.trim(text).toString());
} catch (IllegalArgumentException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
private QName calcXmlName(String uri,String local) {
// compute the default
TODO.checkSpec();
if(local.length()==0 || local.equals("##default"))
local = seed.getName();
if(uri.equals("##default")) {
XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
// JAX-RPC doesn't want the default namespace URI swapping to take effect to
// local "unqualified" elements. UGLY.
if(xs!=null) {
switch(xs.elementFormDefault()) {
case QUALIFIED:
QName typeName = parent.getTypeName();
if(typeName!=null)
uri = typeName.getNamespaceURI();
else
uri = xs.namespace();
if(uri.length()==0)
uri = parent.builder.defaultNsUri;
break;
case UNQUALIFIED:
case UNSET:
uri = "";
}
} else {
uri = "";
}
}
return new QName(uri.intern(),local.intern());
}
public void wildcard(XSWildcard xsWildcard) {
// TODO: implement this method later
// I guess we might allow this to be mapped to a generic element property ---
// not sure exactly how do we do it.
TODO.checkSpec();
throw new UnsupportedOperationException();
}
public static TypeUse makeCollection( TypeUse t ) {
if(t.isCollection()) return t;
CAdapter au = t.getAdapterUse();
if(au!=null && !au.isWhitespaceAdapter()) {
// we can't process this right now.
// for now bind to a weaker type
TODO.checkSpec();
return CBuiltinLeafInfo.STRING_LIST;
}
return new TypeUseImpl( t.getInfo(), true, t.idUse(), t.getExpectedMimeType(), null );
}
/**
* Computes the type name of the array from that of the item type.
*/
public static QName calcArrayTypeName(QName n) {
String uri;
if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
TODO.checkSpec("this URI");
uri = "http://jaxb.dev.java.net/array";
} else
uri = n.getNamespaceURI();
return new QName(uri,n.getLocalPart()+"Array");
}
public URL parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return new URL(WhiteSpaceProcessor.trim(text).toString());
} catch (MalformedURLException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
public UUID parse(CharSequence text) throws SAXException {
TODO.checkSpec("JSR222 Issue #42");
try {
return UUID.fromString(WhiteSpaceProcessor.trim(text).toString());
} catch (IllegalArgumentException e) {
UnmarshallingContext.getInstance().handleError(e);
return null;
}
}
private QName calcXmlName(String uri,String local) {
// compute the default
TODO.checkSpec();
if(local.length()==0 || local.equals("##default"))
local = seed.getName();
if(uri.equals("##default")) {
XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
// JAX-RPC doesn't want the default namespace URI swapping to take effect to
// local "unqualified" elements. UGLY.
if(xs!=null) {
switch(xs.elementFormDefault()) {
case QUALIFIED:
QName typeName = parent.getTypeName();
if(typeName!=null)
uri = typeName.getNamespaceURI();
else
uri = xs.namespace();
if(uri.length()==0)
uri = parent.builder.defaultNsUri;
break;
case UNQUALIFIED:
case UNSET:
uri = "";
}
} else {
uri = "";
}
}
return new QName(uri.intern(),local.intern());
}