/** * Once upon a time, XmlSchema had a bug in the constructor used in this function. So this wrapper was * created to hold a workaround. * * @param namespaceURI TNS for new schema. * @return new schema */ public XmlSchema newXmlSchemaInCollection(String namespaceURI) { return new XmlSchema(namespaceURI, schemaCollection); }
/** * Once upon a time, XmlSchema had a bug in the constructor used in this function. So this wrapper was * created to hold a workaround. * * @param namespaceURI TNS for new schema. * @return new schema */ public XmlSchema newXmlSchemaInCollection(String namespaceURI) { return new XmlSchema(namespaceURI, schemaCollection); }
/** * Once upon a time, XmlSchema had a bug in the constructor used in this function. So this wrapper was * created to hold a workaround. * * @param namespaceURI TNS for new schema. * @return new schema */ public XmlSchema newXmlSchemaInCollection(String namespaceURI) { return new XmlSchema(namespaceURI, schemaCollection); }
/** * Once upon a time, XmlSchema had a bug in the constructor used in this function. So this wrapper was * created to hold a workaround. * * @param namespaceURI TNS for new schema. * @return new schema */ public XmlSchema newXmlSchemaInCollection(String namespaceURI) { return new XmlSchema(namespaceURI, schemaCollection); }
/** * Once upon a time, XmlSchema had a bug in the constructor used in this function. So this wrapper was * created to hold a workaround. * * @param namespaceURI TNS for new schema. * @return new schema */ public XmlSchema newXmlSchemaInCollection(String namespaceURI) { return new XmlSchema(namespaceURI, schemaCollection); }
public XmlSchema createXmlSchema(String schemans, XmlSchemaCollection schemaCol) { XmlSchema xmlSchema = new XmlSchema(schemans, schemaCol); schemas.put(schemans, xmlSchema); return xmlSchema; }
/** * Schema builder constructor * @param collection */ SchemaBuilder(XmlSchemaCollection collection, TargetNamespaceValidator validator) { this.collection = collection; this.validator = validator; if (collection.getExtReg() != null) { this.extReg = collection.getExtReg(); } schema = new XmlSchema(); }
/** * Schema builder constructor * @param collection */ SchemaBuilder(XmlSchemaCollection collection, TargetNamespaceValidator validator) { this.collection = collection; this.validator = validator; if (collection.getExtReg()!=null){ this.extReg = collection.getExtReg(); } schema = new XmlSchema(collection); }
/** * Schema builder constructor * @param collection */ SchemaBuilder(XmlSchemaCollection collection, TargetNamespaceValidator validator) { this.collection = collection; this.validator = validator; if (collection.getExtReg() != null) { this.extReg = collection.getExtReg(); } schema = new XmlSchema(); }
private void initialize(ResolvedType resolvedType) { collection = new XmlSchemaCollection(); final boolean empty = currentElement.isEmpty(); // We use namespace of this element if (empty) { final String target = getTargetNamespace(resolvedType); schema = new XmlSchema(target, "raml-xsd", collection); schema.setTargetNamespace(target); } schema.setElementFormDefault(XmlSchemaForm.QUALIFIED); }
private void initialize(ResolvedType resolvedType) { collection = new XmlSchemaCollection(); final boolean empty = currentElement.isEmpty(); // We use namespace of this element if (empty) { final String target = getTargetNamespace(resolvedType); schema = new XmlSchema(target, "raml-xsd", collection); schema.setTargetNamespace(target); } schema.setElementFormDefault(XmlSchemaForm.QUALIFIED); }
import org.eclipse.persistence.jaxb.metadata.MetadataSourceAdapter; import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings; import org.eclipse.persistence.jaxb.xmlmodel.XmlSchema; public class NameTransformerAdapter extends MetadataSourceAdapter { private XmlBindings bindings; /** * @param packageName Fully qualified package name, like {@code com.example.test} */ public NameTransformerAdapter(String packageName) { bindings = new XmlBindings(); bindings.setPackageName(packageName); bindings.setXmlNameTransformer(XmlNameTransformer.class.getName()); bindings.setXmlSchema(new XmlSchema()); // this is necessary } @Override public XmlBindings getXmlBindings(Map<String, ?> properties, ClassLoader classLoader) { return bindings; } }
/** * Retrieve the XML schema with the given namespace. * @param cparams Common parameters used in the schema generator * @param namespace The target namespace of the XML schema * @return The XML schema object */ private static XmlSchema retrieveSchema(CommonParams cparams, String namespace) { Map<String, XmlSchema> schemaMap = cparams.getSchemaMap(); if (!schemaMap.containsKey(namespace)) { XmlSchema schema = new XmlSchema(namespace, cparams.getXmlSchemaCollection()); schema.setNamespaceContext(new NamespaceMap()); schemaMap.put(namespace, schema); schema.setElementFormDefault(new XmlSchemaForm(XmlSchemaForm.QUALIFIED)); schema.setAttributeFormDefault(new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED)); } return schemaMap.get(namespace); }
protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
@Override protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
@Override protected XmlSchema getXmlSchema(String targetNamespace) { XmlSchema xmlSchema; if ((xmlSchema = schemaMap.get(targetNamespace)) == null) { String targetNamespacePrefix; if (targetNamespace.equals(schemaTargetNameSpace) && schema_namespace_prefix != null) { targetNamespacePrefix = schema_namespace_prefix; } else { targetNamespacePrefix = generatePrefix(); } xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); schemaMap.put(targetNamespace, xmlSchema); NamespaceMap prefixmap = new NamespaceMap(); prefixmap.put(DEFAULT_SCHEMA_NAMESPACE_PREFIX, URI_2001_SCHEMA_XSD); prefixmap.put(targetNamespacePrefix, targetNamespace); xmlSchema.setNamespaceContext(prefixmap); } return xmlSchema; }
wsaSchema = new XmlSchema(ReferenceConstants.WSADDRESSING_NAMESPACE, schemas);
facade = new XmlSchema(ns, AGGREGATED_XSD, schemaCollection);
facade = new XmlSchema(ns, AGGREGATED_XSD, schemaCollection);