Codota Logo
XmlSchemaSerializer.serializeSchema
Code IndexAdd Codota to your IDE (free)

How to use
serializeSchema
method
in
org.apache.ws.commons.schema.XmlSchemaSerializer

Best Java code snippets using org.apache.ws.commons.schema.XmlSchemaSerializer.serializeSchema (Showing top 19 results out of 315)

  • Common ways to obtain XmlSchemaSerializer
private void myMethod () {
XmlSchemaSerializer x =
  • Codota Iconnew XmlSchemaSerializer()
  • Smart code suggestions by Codota
}
origin: apache/cxf

private Object getSchemaNode(XmlSchema schema, SchemaCollection schemaCollection) {
  XmlSchemaSerializer xser = new XmlSchemaSerializer();
  xser.setExtReg(schemaCollection.getExtReg());
  Document[] docs;
  try {
    docs = xser.serializeSchema(schema, false);
  } catch (XmlSchemaSerializerException e) {
    throw new RuntimeException(e);
  }
  return docs[0].getDocumentElement();
}
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception {
origin: org.apache.cxf/cxf-tools-wsdlto-databinding-jaxb

private Object getSchemaNode(XmlSchema schema, SchemaCollection schemaCollection) {
  XmlSchemaSerializer xser = new XmlSchemaSerializer();
  xser.setExtReg(schemaCollection.getExtReg());
  Document[] docs;
  try {
    docs = xser.serializeSchema(schema, false);
  } catch (XmlSchemaSerializerException e) {
    throw new RuntimeException(e);
  }
  return docs[0].getDocumentElement();
}
private InputSource convertToTmpInputSource(Element ele, String schemaLoc) throws Exception {
origin: org.springframework.ws/org.springframework.xml

public Source getSource() {
  // try to use the the package-friendly XmlSchemaSerializer first, fall back to slower stream-based version
  try {
    XmlSchemaSerializer serializer = (XmlSchemaSerializer) BeanUtils.instantiateClass(XmlSchemaSerializer.class)
        ;
    if (collection != null) {
      serializer.setExtReg(collection.getExtReg());
    }
    Document[] serializedSchemas = serializer.serializeSchema(schema, false);
    return new DOMSource(serializedSchemas[0]);
  }
  catch (BeanInstantiationException ex) {
    // ignore
  }
  catch (XmlSchemaSerializer.XmlSchemaSerializerException ex) {
    // ignore
  }
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  schema.write(bos);
  ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
  return new StreamSource(bis);
}
origin: spring-projects/spring-ws

@Override
public Source getSource() {
  // try to use the package-friendly XmlSchemaSerializer first, fall back to slower stream-based version
  try {
    XmlSchemaSerializer serializer = BeanUtils.instantiateClass(XmlSchemaSerializer.class);
    if (collection != null) {
      serializer.setExtReg(collection.getExtReg());
    }
    Document[] serializedSchemas = serializer.serializeSchema(schema, false);
    return new DOMSource(serializedSchemas[0]);
  }
  catch (BeanInstantiationException ex) {
    // ignore
  }
  catch (XmlSchemaSerializer.XmlSchemaSerializerException ex) {
    // ignore
  }
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  try {
    schema.write(bos);
  }
  catch (UnsupportedEncodingException ex) {
    throw new CommonsXsdSchemaException(ex.getMessage(), ex);
  }
  ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
  return new StreamSource(bis);
}
origin: apache/servicemix-bundles

@Override
public Source getSource() {
  // try to use the package-friendly XmlSchemaSerializer first, fall back to slower stream-based version
  try {
    XmlSchemaSerializer serializer = BeanUtils.instantiateClass(XmlSchemaSerializer.class);
    if (collection != null) {
      serializer.setExtReg(collection.getExtReg());
    }
    Document[] serializedSchemas = serializer.serializeSchema(schema, false);
    return new DOMSource(serializedSchemas[0]);
  }
  catch (BeanInstantiationException ex) {
    // ignore
  }
  catch (XmlSchemaSerializer.XmlSchemaSerializerException ex) {
    // ignore
  }
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  try {
    schema.write(bos);
  }
  catch (UnsupportedEncodingException ex) {
    throw new CommonsXsdSchemaException(ex.getMessage(), ex);
  }
  ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
  return new StreamSource(bis);
}
origin: org.apache.ws.commons.schema/XmlSchema

/**
 * Retrieve a DOM tree for this one schema, independent of any included or 
 * related schemas.
 * @return The DOM document.
 * @throws XmlSchemaSerializerException
 */
public Document getSchemaDocument() throws XmlSchemaSerializerException {
  XmlSchemaSerializer xser = new XmlSchemaSerializer();
  xser.setExtReg(this.parent.getExtReg());
  return xser.serializeSchema(this, false)[0];
}

origin: org.apache.ws.schema/XmlSchema

/**
 * Retrieve a DOM tree for this one schema, independent of any included or 
 * related schemas.
 * @return The DOM document.
 * @throws XmlSchemaSerializerException
 */
public Document getSchemaDocument() throws XmlSchemaSerializerException {
  XmlSchemaSerializer xser = new XmlSchemaSerializer();
  xser.setExtReg(this.parent.getExtReg());
  return xser.serializeSchema(this, false)[0];
}

origin: org.apache.ws.schema/XmlSchema

XmlSchemaSerializer xser = new XmlSchemaSerializer();
xser.setExtReg(this.parent.getExtReg());
Document[] serializedSchemas = xser.serializeSchema(schema, false);
TransformerFactory trFac = TransformerFactory.newInstance();
origin: apache/cxf

  continue;
Document document = new XmlSchemaSerializer().serializeSchema(schema, false)[0];
DOMLSInput input = new DOMLSInput(document, schema.getTargetNamespace());
resolverMap.put(schema.getTargetNamespace(), input);
origin: org.apache.ws.commons.schema/XmlSchema

XmlSchemaSerializer xser = new XmlSchemaSerializer();
xser.setExtReg(this.parent.getExtReg());
Document[] serializedSchemas = xser.serializeSchema(schema, false);
TransformerFactory trFac = TransformerFactory.newInstance();
origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

XmlSchemaSerializer xser = new XmlSchemaSerializer();
xser.setExtReg(this.parent.getExtReg());
Document[] serializedSchemas = xser.serializeSchema(schema, false);
TransformerFactory trFac = TransformerFactory.newInstance();
origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

public Document[] getAllSchemas() {
  try {
    XmlSchemaSerializer xser = new XmlSchemaSerializer();
    xser.setExtReg(this.parent.getExtReg());
    return xser.serializeSchema(this, true);
  } catch (XmlSchemaSerializer.XmlSchemaSerializerException e) {
    throw new XmlSchemaException(e.getMessage());
  }
}
origin: org.apache.ws.schema/XmlSchema

public Document[] getAllSchemas() {
  try {
    XmlSchemaSerializer xser = new XmlSchemaSerializer();
    xser.setExtReg(this.parent.getExtReg());
    return xser.serializeSchema(this, true);
  } catch (XmlSchemaSerializer.XmlSchemaSerializerException e) {
    throw new XmlSchemaException(e.getMessage());
  }
}
origin: org.apache.ws.commons.schema/XmlSchema

public Document[] getAllSchemas() {
  try {
    XmlSchemaSerializer xser = new XmlSchemaSerializer();
    xser.setExtReg(this.parent.getExtReg());
    return xser.serializeSchema(this, true);
  } catch (XmlSchemaSerializer.XmlSchemaSerializerException e) {
    throw new XmlSchemaException(e.getMessage());
  }
}
origin: apache/cxf

Document[] docs;
try {
  docs = xser.serializeSchema(schema, false);
} catch (XmlSchemaSerializerException e) {
  throw new RuntimeException(e);
origin: org.apache.cxf/cxf-rt-frontend-simple

Document[] docs;
try {
  docs = xser.serializeSchema(schema, false);
} catch (XmlSchemaSerializerException e) {
  throw new RuntimeException(e);
origin: apache/cxf

Document[] docs;
try {
  docs = xser.serializeSchema(schema, false);
} catch (XmlSchemaSerializerException e) {
  throw new RuntimeException(e);
origin: org.apache.cxf/cxf-tools-wsdlto-databinding-jaxb

Document[] docs;
try {
  docs = xser.serializeSchema(schema, false);
} catch (XmlSchemaSerializerException e) {
  throw new RuntimeException(e);
origin: org.apache.cxf/cxf-xerces-xsd-validation

  void tryToParseSchemas(XmlSchemaCollection collection, DOMErrorHandler handler)
    throws XmlSchemaSerializerException, TransformerException {

    final List<DOMLSInput> inputs = new ArrayList<DOMLSInput>();
    final Map<String, LSInput> resolverMap = new HashMap<String, LSInput>();

    for (XmlSchema schema : collection.getXmlSchemas()) {
      if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(schema.getTargetNamespace())) {
        continue;
      }
      Document document = new XmlSchemaSerializer().serializeSchema(schema, false)[0];
      DOMLSInput input = new DOMLSInput(document, schema.getTargetNamespace());
      resolverMap.put(schema.getTargetNamespace(), input);
      inputs.add(input);
    }

    XSLoader schemaLoader = impl.createXSLoader(null);
    schemaLoader.getConfig().setParameter("validate", Boolean.TRUE);
    schemaLoader.getConfig().setParameter("error-handler", handler);
    schemaLoader.getConfig().setParameter("resource-resolver", new LSResourceResolver() {

      public LSInput resolveResource(String type, String namespaceURI, String publicId,
                      String systemId, String baseURI) {
        return resolverMap.get(namespaceURI);
      }
    });

    schemaLoader.loadInputList(new ListLSInput(inputs));
  }
}
org.apache.ws.commons.schemaXmlSchemaSerializerserializeSchema

Javadoc

* Document[] serializeSchema(XmlSchema schemaObj, boolean serializeIncluded)

Serialize XmlSchema object pass back the document containing a schema element as its root.

Parameter: schemaObj - Schema object to serialize. serialzeIncluded - whether to serialize the included(imported) schema or not. pass true for serialize all included schema.

Return: Array of Documents that include/imported. *

Popular methods of XmlSchemaSerializer

  • setExtReg
    Set the registry of extensions for this serializer.
  • <init>
    Create a new serializer.
  • appendElement
  • constructFacet
  • convertString
  • createNewElement
  • getParts
  • processExtensibilityComponents
    A generic method to process the extra attributes and the the extra elements present within the schem
  • resolveQName
    will search whether the prefix is available in global hash table, if it is there than append the pre
  • serializeAll
    * Element serializeAll(Document doc, XmlSchemaAll allObj, XmlSchema schema) throws XmlSchemaSerializ
  • serializeAnnotation
    * Element serializeAnnotation(Document doc, XmlSchemaAnnotation annotationObj, XmlSchema schema) E
  • serializeAny
    * Element serializeAny(Document doc, XmlSchemaAny anyObj, XmlSchema schema) Each member of complex t
  • serializeAnnotation,
  • serializeAny,
  • serializeAnyAttribute,
  • serializeAppInfo,
  • serializeAttribute,
  • serializeAttributeGroup,
  • serializeAttributeGroupRef,
  • serializeChoice,
  • serializeComplexContent

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BoxLayout (javax.swing)
  • JOptionPane (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now