zoukankan      html  css  js  c++  java
  • JAXB

    This annotation can only be used with a package. It defines parameters that are derived from the xsd:schema element. It must be written on a file package-info.java situated in the package. Below is an example, specifying the namespace and elementFormDefault elements.

    @javax.xml.bind.annotation.XmlSchema(
        namespace = "http://www.laune.at/hospital", 
        elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
    package hospital;

    This annotation is equivalent to an xs:schema element

    <xs:schema elementFormDefault="qualified"
               targetNamespace="http://www.laune.at/hospital"
               xmlns:tns="http://www.laune.at/hospital"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               version="1.0" >

    For defining namespace prefixes you use the xmlns element of the XmlSchema annotation. It contains an array of XmlNs annotations, each of which contains a prefix and anamespaceURI element. The previous example is extended with a namespace definition for the prefix med:

    @javax.xml.bind.annotation.XmlSchema(
        namespace = "http://www.laune.at/hospital", 
            xmlns = { @javax.xml.bind.annotation.XmlNs( prefix = "med",
                      namespaceURI = "http://www.laune.at/med" ) },
        elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
    package hospital;

    This corresponds to using xmlns:med="http://www.laune.at/med" as an attribute in the xs:schema element.

  • 相关阅读:
    Keras学习笔记——Hello Keras
    记一次线上事故的JVM内存学习
    postgresql中的search_path
    CentOS7安装setuptools
    CentOS7安装EPEL的两种方式
    Ncures库的介绍与安装
    CentOs6.5 安装Zlib
    Centos 安装zlib
    Windows如何压缩tar.gz格式
    nginx运行文件出错env: /etc/init.d/nginx: No such file or directory
  • 原文地址:https://www.cnblogs.com/huey/p/5511725.html
Copyright © 2011-2022 走看看