下面列出了javax.xml.bind.annotation.XmlMixed#com.sun.tools.internal.xjc.model.nav.NClass 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
static NClass getRef( final Class<? extends XmlAdapter> adapter, boolean copy ) {
if(copy) {
// TODO: this is a hack. the code generation should be defered until
// the backend. (right now constant generation happens in the front-end)
return new EagerNClass(adapter) {
@Override
public JClass toType(Outline o, Aspect aspect) {
return o.addRuntime(adapter);
}
public String fullName() {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
};
} else {
return NavigatorImpl.theInstance.ref(adapter);
}
}
static NClass getRef( final Class<? extends XmlAdapter> adapter, boolean copy ) {
if(copy) {
// TODO: this is a hack. the code generation should be defered until
// the backend. (right now constant generation happens in the front-end)
return new EagerNClass(adapter) {
@Override
public JClass toType(Outline o, Aspect aspect) {
return o.addRuntime(adapter);
}
public String fullName() {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
};
} else {
return NavigatorImpl.theInstance.ref(adapter);
}
}
static NClass getRef( final Class<? extends XmlAdapter> adapter, boolean copy ) {
if(copy) {
// TODO: this is a hack. the code generation should be defered until
// the backend. (right now constant generation happens in the front-end)
return new EagerNClass(adapter) {
@Override
public JClass toType(Outline o, Aspect aspect) {
return o.addRuntime(adapter);
}
public String fullName() {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
};
} else {
return NavigatorImpl.theInstance.ref(adapter);
}
}
static NClass getRef( final Class<? extends XmlAdapter> adapter, boolean copy ) {
if(copy) {
// TODO: this is a hack. the code generation should be defered until
// the backend. (right now constant generation happens in the front-end)
return new EagerNClass(adapter) {
@Override
public JClass toType(Outline o, Aspect aspect) {
return o.addRuntime(adapter);
}
public String fullName() {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
};
} else {
return NavigatorImpl.theInstance.ref(adapter);
}
}
static NClass getRef( final Class<? extends XmlAdapter> adapter, boolean copy ) {
if(copy) {
// TODO: this is a hack. the code generation should be defered until
// the backend. (right now constant generation happens in the front-end)
return new EagerNClass(adapter) {
@Override
public JClass toType(Outline o, Aspect aspect) {
return o.addRuntime(adapter);
}
public String fullName() {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
};
} else {
return NavigatorImpl.theInstance.ref(adapter);
}
}
public NClass getDOMHandler() {
// TODO: support other DOM handlers
if(getWildcard()!=null)
return NavigatorImpl.create(W3CDomHandler.class);
else
return null;
}
public CElementInfo getElementInfo(NClass scope,QName name) {
Map<QName,CElementInfo> m = elementMappings.get(scope);
if(m!=null) {
CElementInfo r = m.get(name);
if(r!=null) return r;
}
return elementMappings.get(null).get(name);
}
public NClass getDOMHandler() {
// TODO: support other DOM handlers
if(getWildcard()!=null)
return NavigatorImpl.create(W3CDomHandler.class);
else
return null;
}
public CElementInfo getElementInfo(NClass scope,QName name) {
Map<QName,CElementInfo> m = elementMappings.get(scope);
if(m!=null) {
CElementInfo r = m.get(name);
if(r!=null) return r;
}
return elementMappings.get(null).get(name);
}
void add( CElementInfo ei ) {
NClass clazz = null;
if(ei.getScope()!=null)
clazz = ei.getScope().getClazz();
Map<QName,CElementInfo> m = elementMappings.get(clazz);
if(m==null)
elementMappings.put(clazz,m=new HashMap<QName,CElementInfo>());
m.put(ei.getElementName(),ei);
}
public NClass getDOMHandler() {
// TODO: support other DOM handlers
if(getWildcard()!=null)
return NavigatorImpl.create(W3CDomHandler.class);
else
return null;
}
public CElementInfo getElementInfo(NClass scope,QName name) {
Map<QName,CElementInfo> m = elementMappings.get(scope);
if(m!=null) {
CElementInfo r = m.get(name);
if(r!=null) return r;
}
return elementMappings.get(null).get(name);
}
void add( CElementInfo ei ) {
NClass clazz = null;
if(ei.getScope()!=null)
clazz = ei.getScope().getClazz();
Map<QName,CElementInfo> m = elementMappings.get(clazz);
if(m==null)
elementMappings.put(clazz,m=new HashMap<QName,CElementInfo>());
m.put(ei.getElementName(),ei);
}
public NClass getDOMHandler() {
// TODO: support other DOM handlers
if(getWildcard()!=null)
return NavigatorImpl.create(W3CDomHandler.class);
else
return null;
}
public CElementInfo getElementInfo(NClass scope,QName name) {
Map<QName,CElementInfo> m = elementMappings.get(scope);
if(m!=null) {
CElementInfo r = m.get(name);
if(r!=null) return r;
}
return elementMappings.get(null).get(name);
}
void add( CElementInfo ei ) {
NClass clazz = null;
if(ei.getScope()!=null)
clazz = ei.getScope().getClazz();
Map<QName,CElementInfo> m = elementMappings.get(clazz);
if(m==null)
elementMappings.put(clazz,m=new HashMap<QName,CElementInfo>());
m.put(ei.getElementName(),ei);
}
public NClass getDOMHandler() {
// TODO: support other DOM handlers
if(getWildcard()!=null)
return NavigatorImpl.create(W3CDomHandler.class);
else
return null;
}
public CElementInfo getElementInfo(NClass scope,QName name) {
Map<QName,CElementInfo> m = elementMappings.get(scope);
if(m!=null) {
CElementInfo r = m.get(name);
if(r!=null) return r;
}
return elementMappings.get(null).get(name);
}
/**
* @deprecated always return null at this level.
*/
public final Element<NType,NClass> asElement() {
return null;
}
public PropertyInfo<NType, NClass> getSource() {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
public Element<NType,NClass> asElement() {
return null;
}
public NClass getClazz() {
return this;
}
public NonElement<NType,NClass> getBaseType() {
return base;
}
public Navigator<NType,NClass,Void,Void> getNavigator() {
return NavigatorImpl.theInstance;
}
public CNonElement getTypeInfo(Ref<NType,NClass> ref) {
// TODO: handle XmlValueList
assert !ref.valueList;
return getTypeInfo(ref.type);
}
public Map<NClass,CClassInfo> beans() {
return beans;
}
public Map<NClass,CEnumLeafInfo> enums() {
return enums;
}
public CClassInfo getClassInfo(NClass t) {
return beans.get(t);
}
public Map<QName,CElementInfo> getElementMappings(NClass scope) {
return elementMappings.get(scope);
}
public final NClass getType() {
return this;
}