gpt4 book ai didi

org.apache.commons.betwixt.XMLIntrospector.register()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 16:39:40 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.commons.betwixt.XMLIntrospector.register()方法的一些代码示例,展示了XMLIntrospector.register()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLIntrospector.register()方法的具体详情如下:
包路径:org.apache.commons.betwixt.XMLIntrospector
类名称:XMLIntrospector
方法名:register

XMLIntrospector.register介绍

暂无

代码示例

代码示例来源:origin: org.fcrepo/fcrepo-server

public void write(Writer outputWriter) throws IOException {
  outputWriter.write("<?xml version='1.0' ?>\n");
  BeanWriter beanWriter = new BeanWriter(outputWriter);
  beanWriter.getBindingConfiguration().setMapIDs(false);
  beanWriter.setWriteEmptyElements(false);
  beanWriter.enablePrettyPrint();
  try {
    beanWriter.getXMLIntrospector().register(getBetwixtMapping());
    beanWriter.write("users", this);
  } catch (IntrospectionException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (SAXException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  beanWriter.flush();
  beanWriter.close();
}

代码示例来源:origin: fcrepo3/fcrepo

public void write(Writer outputWriter) throws IOException {
  outputWriter.write("<?xml version='1.0' ?>\n");
  BeanWriter beanWriter = new BeanWriter(outputWriter);
  beanWriter.getBindingConfiguration().setMapIDs(false);
  beanWriter.setWriteEmptyElements(false);
  beanWriter.enablePrettyPrint();
  try {
    beanWriter.getXMLIntrospector().register(getBetwixtMapping());
    beanWriter.write("users", this);
  } catch (IntrospectionException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (SAXException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  beanWriter.flush();
  beanWriter.close();
}

代码示例来源:origin: fcrepo3/fcrepo

public void write(Writer outputWriter) throws IOException {
  //
  NamespacePrefixMapper nspm = new NamespacePrefixMapper();
  nspm.setPrefix(XSI.uri, "xsi");
  nspm.setPrefix("http://java.sun.com/xml/ns/j2ee", "xmlns");
  //
  outputWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
  BeanWriter beanWriter = new BeanWriter(outputWriter);
  beanWriter.getBindingConfiguration().setMapIDs(false);
  beanWriter.setWriteEmptyElements(false);
  beanWriter.enablePrettyPrint();
  try {
    beanWriter.getXMLIntrospector().register(getBetwixtMapping());
    beanWriter.getXMLIntrospector().getConfiguration()
        .setPrefixMapper(nspm);
    beanWriter.write("web-app", this);
  } catch (IntrospectionException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (SAXException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  beanWriter.flush();
  beanWriter.close();
}

代码示例来源:origin: org.fcrepo/fcrepo-server

public void write(Writer outputWriter) throws IOException {
  //
  NamespacePrefixMapper nspm = new NamespacePrefixMapper();
  nspm.setPrefix(XSI.uri, "xsi");
  nspm.setPrefix("http://java.sun.com/xml/ns/j2ee", "xmlns");
  //
  outputWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
  BeanWriter beanWriter = new BeanWriter(outputWriter);
  beanWriter.getBindingConfiguration().setMapIDs(false);
  beanWriter.setWriteEmptyElements(false);
  beanWriter.enablePrettyPrint();
  try {
    beanWriter.getXMLIntrospector().register(getBetwixtMapping());
    beanWriter.getXMLIntrospector().getConfiguration()
        .setPrefixMapper(nspm);
    beanWriter.write("web-app", this);
  } catch (IntrospectionException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (SAXException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  beanWriter.flush();
  beanWriter.close();
}

代码示例来源:origin: org.jumpmind.symmetric/symmetric-ddl

protected BeanWriter getWriter(Writer output) throws DdlUtilsException
{
  try
  {
    BeanWriter writer = new BeanWriter(output);

    writer.getXMLIntrospector().register(getBetwixtMapping());
    writer.getXMLIntrospector().getConfiguration().setAttributesForPrimitives(true);
    writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(false);
    writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new HyphenatedNameMapper());
    writer.getBindingConfiguration().setMapIDs(false);
    writer.enablePrettyPrint();

    return writer;
  }
  catch (Exception ex)
  {
    throw new DdlUtilsException(ex);
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com