当前位置: 首页>>代码示例>>Java>>正文


Java PropertyException.printStackTrace方法代码示例

本文整理汇总了Java中javax.xml.bind.PropertyException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyException.printStackTrace方法的具体用法?Java PropertyException.printStackTrace怎么用?Java PropertyException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.xml.bind.PropertyException的用法示例。


在下文中一共展示了PropertyException.printStackTrace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: marshallData

import javax.xml.bind.PropertyException; //导入方法依赖的package包/类
public static void marshallData(IndoorFeaturesType ifs) throws JAXBException {
    File file = new File("indoorExample.xml");
    JAXBContext jaxbContext = JAXBContext.newInstance(IndoorFeaturesType.class);
    Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
    try {
        jaxbMarshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new IndoorGMLNamespaceMapper());
    } catch (PropertyException e) {
        // In case another JAXB implementation is used
        e.printStackTrace();
    }
    // output pretty printed
    jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

    jaxbMarshaller.marshal(ifs, file);
    jaxbMarshaller.marshal(ifs, System.out);
}
 
开发者ID:STEMLab,项目名称:JOSM-IndoorEditor,代码行数:17,代码来源:IndoorGML_Test.java

示例2: marshallData

import javax.xml.bind.PropertyException; //导入方法依赖的package包/类
public static void marshallData(FeatureCollectionType ifs) throws JAXBException {
    File file = new File("gmltest.gml");
    JAXBContext jaxbContext = JAXBContext.newInstance(FeatureCollectionType.class, CustomPointFeatureMember.class, CustomLineFeatureMember.class);
    Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
    try {
        jaxbMarshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new GMLNamespaceMapper());
    } catch (PropertyException e) {
        // In case another JAXB implementation is used
        e.printStackTrace();
    }
    // output pretty printed
    jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
    net.opengis.gml.v_3_2_1.ObjectFactory gmlObjfact = new net.opengis.gml.v_3_2_1.ObjectFactory();
    JAXBElement<?> elem = gmlObjfact.createFeatureCollection(ifs);

    jaxbMarshaller.marshal(elem, file);
    jaxbMarshaller.marshal(elem, System.out);
}
 
开发者ID:STEMLab,项目名称:JOSM-IndoorEditor,代码行数:19,代码来源:IgmlToGML.java

示例3: decorate

import javax.xml.bind.PropertyException; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public Marshaller decorate(Marshaller target, Pretty annotation,Class type, Annotation[] annotations, MediaType mediaType) {
	try {
		target.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
	} catch (PropertyException e) {
		e.printStackTrace();
	}
	return target;
}
 
开发者ID:ameizi,项目名称:resteasy-restfull-examples,代码行数:10,代码来源:PrettyProcessor.java


注:本文中的javax.xml.bind.PropertyException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。