本文整理了Java中org.jvnet.hk2.config.Dom.getSymbolSpaceRoot()
方法的一些代码示例,展示了Dom.getSymbolSpaceRoot()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dom.getSymbolSpaceRoot()
方法的具体详情如下:
包路径:org.jvnet.hk2.config.Dom
类名称:Dom
方法名:getSymbolSpaceRoot
[英]Locates the DOM that serves as the symbol space root.
[中]
代码示例来源:origin: javaee/glassfish
/**
* Resolves a reference to the given type by the given id.
*/
public final <T> T reference(Dom dom, String id, Class<T> type) {
// TODO: this doesn't work in case where type is a subtype of indexed type.
String name = type.getName();
dom = dom.getSymbolSpaceRoot(name);
return type.cast(dom.resolveReference(id,name).get());
}
}
代码示例来源:origin: javaee/glassfish
protected Object convertLeafValue(Dom parent, Class<?> returnType, String v) {
// let's look first the fast way.
Object candidate = parent.getHabitat().getService(returnType, v);
if (candidate!=null) {
return returnType.cast(candidate);
}
parent = parent.getSymbolSpaceRoot(v);
Dom dom = parent.resolveReference(v,returnType.getName());
if (dom!=null) {
return returnType.cast(dom.get());
} else {
throw new IllegalArgumentException("Cannot find an instance of " + returnType + " named " + v);
}
}
代码示例来源:origin: javaee/glassfish
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.leafElement(xmlName);
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getService(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: javaee/glassfish
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.attribute(xmlName);
// since the id is supposed to be the element's key, if no key, no element.
if (id==null) {
return null;
}
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getService(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: com.sun.enterprise/config
/**
* Resolves a reference to the given type by the given id.
*/
public final <T> T reference(Dom dom, String id, Class<T> type) {
// TODO: this doesn't work in case where type is a subtype of indexed type.
String name = type.getName();
dom = dom.getSymbolSpaceRoot(name);
return type.cast(dom.resolveReference(id,name).get());
}
}
代码示例来源:origin: eclipse-ee4j/glassfish
/**
* Resolves a reference to the given type by the given id.
*/
public final <T> T reference(Dom dom, String id, Class<T> type) {
// TODO: this doesn't work in case where type is a subtype of indexed type.
String name = type.getName();
dom = dom.getSymbolSpaceRoot(name);
return type.cast(dom.resolveReference(id,name).get());
}
}
代码示例来源:origin: org.glassfish.hk2/hk2-config
/**
* Resolves a reference to the given type by the given id.
*/
public final <T> T reference(Dom dom, String id, Class<T> type) {
// TODO: this doesn't work in case where type is a subtype of indexed type.
String name = type.getName();
dom = dom.getSymbolSpaceRoot(name);
return type.cast(dom.resolveReference(id,name).get());
}
}
代码示例来源:origin: org.glassfish.hk2/config
/**
* Resolves a reference to the given type by the given id.
*/
public final <T> T reference(Dom dom, String id, Class<T> type) {
// TODO: this doesn't work in case where type is a subtype of indexed type.
String name = type.getName();
dom = dom.getSymbolSpaceRoot(name);
return type.cast(dom.resolveReference(id,name).get());
}
}
代码示例来源:origin: org.glassfish.hk2/config
protected Object convertLeafValue(Dom parent, Class<?> returnType, String v) {
// let's look first the fast way.
Object candidate = parent.getHabitat().getComponent(returnType, v);
if (candidate!=null) {
return returnType.cast(candidate);
}
parent = parent.getSymbolSpaceRoot(v);
Dom dom = parent==null?null:parent.resolveReference(v,returnType.getName());
if (dom!=null) {
return returnType.cast(dom.get());
} else {
throw new IllegalArgumentException("Cannot find an instance of " + returnType + " named " + v);
}
}
代码示例来源:origin: org.glassfish.hk2/hk2-config
protected Object convertLeafValue(Dom parent, Class<?> returnType, String v) {
// let's look first the fast way.
Object candidate = parent.getHabitat().getService(returnType, v);
if (candidate!=null) {
return returnType.cast(candidate);
}
parent = parent.getSymbolSpaceRoot(v);
Dom dom = parent==null?null:parent.resolveReference(v,returnType.getName());
if (dom!=null) {
return returnType.cast(dom.get());
} else {
throw new IllegalArgumentException("Cannot find an instance of " + returnType + " named " + v);
}
}
代码示例来源:origin: eclipse-ee4j/glassfish
protected Object convertLeafValue(Dom parent, Class<?> returnType, String v) {
// let's look first the fast way.
Object candidate = parent.getHabitat().getService(returnType, v);
if (candidate!=null) {
return returnType.cast(candidate);
}
parent = parent.getSymbolSpaceRoot(v);
Dom dom = parent.resolveReference(v,returnType.getName());
if (dom!=null) {
return returnType.cast(dom.get());
} else {
throw new IllegalArgumentException("Cannot find an instance of " + returnType + " named " + v);
}
}
代码示例来源:origin: org.glassfish.hk2/hk2-config
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.leafElement(xmlName);
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getService(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: org.glassfish.hk2/config
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.leafElement(xmlName);
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getComponent(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: com.sun.enterprise/config
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.leafElement(xmlName);
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getComponent(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: eclipse-ee4j/glassfish
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.leafElement(xmlName);
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getService(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: org.glassfish.hk2/config
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.attribute(xmlName);
// since the id is supposed to be the element's key, if no key, no element.
if (id==null) {
return null;
}
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getComponent(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: com.sun.enterprise/config
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.attribute(xmlName);
// since the id is supposed to be the element's key, if no key, no element.
if (id==null) {
return null;
}
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getComponent(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: org.glassfish.hk2/hk2-config
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.attribute(xmlName);
// since the id is supposed to be the element's key, if no key, no element.
if (id==null) {
return null;
}
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getService(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
代码示例来源:origin: eclipse-ee4j/glassfish
@Override
public Object get(Dom dom, Type returnType) {
String id = dom.attribute(xmlName);
// since the id is supposed to be the element's key, if no key, no element.
if (id==null) {
return null;
}
Class<?> type = Types.erasure(returnType);
// let's look first the fast way.
Object candidate = dom.getHabitat().getService(type, id);
if (candidate!=null) {
return type.cast(candidate);
}
dom = dom.getSymbolSpaceRoot(id);
return type.cast(dom.resolveReference(id,type.getName()).get());
}
内容来源于网络,如有侵权,请联系作者删除!