本文整理汇总了Java中com.sun.xml.internal.ws.developer.UsesJAXBContextFeature类的典型用法代码示例。如果您正苦于以下问题:Java UsesJAXBContextFeature类的具体用法?Java UsesJAXBContextFeature怎么用?Java UsesJAXBContextFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsesJAXBContextFeature类属于com.sun.xml.internal.ws.developer包,在下文中一共展示了UsesJAXBContextFeature类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createJAXBContext
import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature; //导入依赖的package包/类
private JAXBRIContext createJAXBContext() {
final List<TypeReference> types = getAllTypeReferences();
final List<Class> cls = new ArrayList<Class>(types.size() + additionalClasses.size());
cls.addAll(additionalClasses);
for (TypeReference type : types)
cls.add((Class) type.type);
try {
//jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
// Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
jaxbContext = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBRIContext>() {
public JAXBRIContext run() throws Exception {
if(LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,"Creating JAXBContext with classes="+cls+" and types="+types);
}
UsesJAXBContextFeature f = WebServiceFeatureList.getFeature(features, UsesJAXBContextFeature.class);
JAXBContextFactory factory = f!=null ? f.getFactory() : null;
if(factory==null) factory=JAXBContextFactory.DEFAULT;
return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types);
}
});
createBridgeMap(types);
} catch (PrivilegedActionException e) {
throw new WebServiceException(ModelerMessages.UNABLE_TO_CREATE_JAXB_CONTEXT(), e);
}
knownNamespaceURIs = new ArrayList<String>();
for (String namespace : jaxbContext.getKnownNamespaceURIs()) {
if (namespace.length() > 0) {
if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
knownNamespaceURIs.add(namespace);
}
}
marshallers = new Pool.Marshaller(jaxbContext);
return jaxbContext;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:39,代码来源:AbstractSEIModelImpl.java
示例2: createJAXBContext
import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature; //导入依赖的package包/类
private void /*JAXBRIContext*/ createJAXBContext() {
final List<TypeInfo> types = getAllTypeInfos();
final List<Class> cls = new ArrayList<Class>(types.size() + additionalClasses.size());
cls.addAll(additionalClasses);
for (TypeInfo type : types) {
cls.add((Class) type.type);
}
try {
//jaxbContext = JAXBRIContext.newInstance(cls, types, targetNamespace, false);
// Need to avoid doPriv block once JAXB is fixed. Afterwards, use the above
bindingContext = AccessController.doPrivileged(new PrivilegedExceptionAction<BindingContext>() {
public BindingContext run() throws Exception {
if(LOGGER.isLoggable(Level.FINEST)) {
LOGGER.log(Level.FINEST, "Creating JAXBContext with classes={0} and types={1}", new Object[]{cls, types});
}
UsesJAXBContextFeature f = features.get(UsesJAXBContextFeature.class);
com.oracle.webservices.internal.api.databinding.DatabindingModeFeature dmf =
features.get(com.oracle.webservices.internal.api.databinding.DatabindingModeFeature.class);
JAXBContextFactory factory = f!=null ? f.getFactory() : null;
if(factory==null) factory=JAXBContextFactory.DEFAULT;
// return factory.createJAXBContext(AbstractSEIModelImpl.this,cls,types);
databindingInfo.properties().put(JAXBContextFactory.class.getName(), factory);
if (dmf != null) {
if (LOGGER.isLoggable(Level.FINE))
LOGGER.log(Level.FINE, "DatabindingModeFeature in SEI specifies mode: {0}", dmf.getMode());
databindingInfo.setDatabindingMode(dmf
.getMode());
}
if (f!=null) databindingInfo.setDatabindingMode(BindingContextFactory.DefaultDatabindingMode);
databindingInfo.setClassLoader(classLoader);
databindingInfo.contentClasses().addAll(cls);
databindingInfo.typeInfos().addAll(types);
databindingInfo.properties().put("c14nSupport", Boolean.FALSE);
databindingInfo.setDefaultNamespace(AbstractSEIModelImpl.this.getDefaultSchemaNamespace());
BindingContext bc = BindingContextFactory.create(databindingInfo);
if (LOGGER.isLoggable(Level.FINE))
LOGGER.log(Level.FINE,
"Created binding context: "
+ bc.getClass().getName());
// System.out.println("---------------------- databinding " + bc);
return bc;
}
});
// createBridgeMap(types);
createBondMap(types);
} catch (PrivilegedActionException e) {
throw new WebServiceException(ModelerMessages.UNABLE_TO_CREATE_JAXB_CONTEXT(), e);
}
knownNamespaceURIs = new ArrayList<String>();
for (String namespace : bindingContext.getKnownNamespaceURIs()) {
if (namespace.length() > 0) {
if (!namespace.equals(SOAPNamespaceConstants.XSD) && !namespace.equals(SOAPNamespaceConstants.XMLNS))
knownNamespaceURIs.add(namespace);
}
}
marshallers = new Pool.Marshaller(jaxbContext);
//return getJAXBContext();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:66,代码来源:AbstractSEIModelImpl.java
示例3: useOwnSEIModel
import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature; //导入依赖的package包/类
private boolean useOwnSEIModel(WebServiceFeatureList features) {
return features.contains(UsesJAXBContextFeature.class);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:WSServiceDelegate.java
示例4: useOwnSEIModel
import com.sun.xml.internal.ws.developer.UsesJAXBContextFeature; //导入依赖的package包/类
private boolean useOwnSEIModel(WebServiceFeature... features) {
return WebServiceFeatureList.getFeature(features, UsesJAXBContextFeature.class) != null;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:4,代码来源:WSServiceDelegate.java
注:本文中的com.sun.xml.internal.ws.developer.UsesJAXBContextFeature类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论