com.sun.xml.internal.bind.v2.schemagen.xmlschema.AttrDecls Java Examples
The following examples show how to use
com.sun.xml.internal.bind.v2.schemagen.xmlschema.AttrDecls.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XmlSchemaGenerator.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }
Example #2
Source File: XmlSchemaGenerator.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }
Example #3
Source File: XmlSchemaGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }
Example #4
Source File: XmlSchemaGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }
Example #5
Source File: XmlSchemaGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }
Example #6
Source File: XmlSchemaGenerator.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }
Example #7
Source File: XmlSchemaGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }
Example #8
Source File: XmlSchemaGenerator.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Generate an attribute for the specified property on the specified complexType * * @param ap the attribute * @param attr the schema definition to which the attribute will be added */ private void handleAttributeProp(AttributePropertyInfo<T,C> ap, AttrDecls attr) { // attr is either a top-level ComplexType or a ComplexExtension // // [RESULT] // // <complexType ...> // <...>...</> // <attribute name="foo" type="xs:int"/> // </> // // or // // <complexType ...> // <complexContent> // <extension ...> // <...>...</> // </> // </> // <attribute name="foo" type="xs:int"/> // </> // // or it could also be an in-lined type (attr ref) // LocalAttribute localAttribute = attr.attribute(); final String attrURI = ap.getXmlName().getNamespaceURI(); if (attrURI.equals("") /*|| attrURI.equals(uri) --- those are generated as global attributes anyway, so use them.*/) { localAttribute.name(ap.getXmlName().getLocalPart()); writeAttributeTypeRef(ap, localAttribute); attributeFormDefault.writeForm(localAttribute,ap.getXmlName()); } else { // generate an attr ref localAttribute.ref(ap.getXmlName()); } if(ap.isRequired()) { // TODO: not type safe localAttribute.use("required"); } }