Java Code Examples for javax.xml.transform.Result#getSystemId()
The following examples show how to use
javax.xml.transform.Result#getSystemId() .
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: XMLOutputFactoryImpl.java From Bytecoder with Apache License 2.0 | 6 votes |
public XMLStreamWriter createXMLStreamWriter(Result result) throws XMLStreamException { if (result instanceof StreamResult) { return createXMLStreamWriter((StreamResult) result, null); } else if (result instanceof DOMResult) { return new XMLDOMWriterImpl((DOMResult) result); } else if (result instanceof StAXResult) { if (((StAXResult) result).getXMLStreamWriter() != null) { return ((StAXResult) result).getXMLStreamWriter(); } else { throw new UnsupportedOperationException( "Result of type " + result + " is not supported"); } } else if (result.getSystemId() != null) { //this is not correct impl of SAXResult. Keep it for now for compatibility return createXMLStreamWriter(new StreamResult(result.getSystemId())); } else { throw new UnsupportedOperationException( "Result of type " + result + " is not supported. Supported result " + "types are: DOMResult, StAXResult and StreamResult."); } }
Example 2
Source File: FoolProofResolver.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 3
Source File: FoolProofResolver.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 4
Source File: FoolProofResolver.java From hottub with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 5
Source File: FoolProofResolver.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 6
Source File: FoolProofResolver.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 7
Source File: FoolProofResolver.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 8
Source File: FoolProofResolver.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 9
Source File: FoolProofResolver.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { logger.entering(getClass().getName(),"createOutput",new Object[]{namespaceUri,suggestedFileName}); Result r = resolver.createOutput(namespaceUri,suggestedFileName); if(r!=null) { String sysId = r.getSystemId(); logger.finer("system ID = "+sysId); if(sysId!=null) { // TODO: make sure that the system Id is absolute // don't use java.net.URI, because it doesn't allow some characters (like SP) // which can legally used as file names. // but don't use java.net.URL either, because it doesn't allow a made-up URI // like kohsuke://foo/bar/zot } else throw new AssertionError("system ID cannot be null"); } logger.exiting(getClass().getName(),"createOutput",r); return r; }
Example 10
Source File: WSDLGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }
Example 11
Source File: WSDLGenerator.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }
Example 12
Source File: WSDLGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }
Example 13
Source File: WSDLGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }
Example 14
Source File: WSDLGenerator.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }
Example 15
Source File: WSDLGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }
Example 16
Source File: WSDLGenerator.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }
Example 17
Source File: WSDLGenerator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Performes the actual WSDL generation */ public void doGeneration() { XmlSerializer serviceWriter; XmlSerializer portWriter = null; String fileName = mangleName(model.getServiceQName().getLocalPart()); Result result = wsdlResolver.getWSDL(fileName + DOT_WSDL); wsdlLocation = result.getSystemId(); serviceWriter = new CommentFilter(ResultFactory.createSerializer(result)); if (model.getServiceQName().getNamespaceURI().equals(model.getTargetNamespace())) { portWriter = serviceWriter; schemaPrefix = fileName + "_"; } else { String wsdlName = mangleName(model.getPortTypeName().getLocalPart()); if (wsdlName.equals(fileName)) wsdlName += "PortType"; Holder<String> absWSDLName = new Holder<String>(); absWSDLName.value = wsdlName + DOT_WSDL; result = wsdlResolver.getAbstractWSDL(absWSDLName); if (result != null) { portWSDLID = result.getSystemId(); if (portWSDLID.equals(wsdlLocation)) { portWriter = serviceWriter; } else { portWriter = new CommentFilter(ResultFactory.createSerializer(result)); } } else { portWSDLID = absWSDLName.value; } schemaPrefix = new java.io.File(portWSDLID).getName(); int idx = schemaPrefix.lastIndexOf('.'); if (idx > 0) schemaPrefix = schemaPrefix.substring(0, idx); schemaPrefix = mangleName(schemaPrefix) + "_"; } generateDocument(serviceWriter, portWriter); }