com.sun.xml.ws.db.sdo
Class SDOUtils

java.lang.Object
  extended by com.sun.xml.ws.db.sdo.SDOUtils

public class SDOUtils
extends Object

A set of core utility methods that shapes the sdo databinding Created by IntelliJ IDEA. User: giglee Date: May 13, 2009 Time: 10:21:12 AM To change this template use File | Settings | File Templates.


Field Summary
(package private) static DocumentBuilderFactory dbf
           
static String NS_WSDL
           
static String NS_XMLNS
           
static QName QNAME_SCHEMA
           
(package private) static TransformerFactory transformerFactory
           
 
Constructor Summary
SDOUtils()
           
 
Method Summary
static Document createDOM(Source wsdlSource)
           
static List defineSchema(commonj.sdo.helper.HelperContext hc, File f)
           
static String dom2String(DOMSource domSrc)
           
static Map<String,Source> getMetadataClosure(List<Source> schemas)
           
static QName getPropertyElementName(commonj.sdo.helper.HelperContext context, commonj.sdo.Property p)
          get the element name represented by this property
static List<Source> getSchemaClosureFromWSDL(Source wsdlSource)
           
static Set<SchemaInfo> getSchemas(File f)
           
static Set<SchemaInfo> getSchemas(String filePath)
           
static Document newDocument()
           
static DocumentBuilder newDocumentBuilder()
           
static Transformer newTransformer()
           
static void printDOM(Source src)
           
static void printXMLReader(javax.xml.stream.XMLStreamReader xml)
           
static void registerSDOContext(commonj.sdo.helper.HelperContext context, List<Source> schemas)
          Register the types defined in the given schema with the given sdo helper context
static Element sdoToDom(commonj.sdo.helper.HelperContext hc, commonj.sdo.DataObject obj, String targetNamespace, String localName)
          Serialize a DataObject to the specified element Per bug 6120620,, we use only GMT timezone
static Source sdoToXML(commonj.sdo.helper.HelperContext hc, commonj.sdo.DataObject obj, String targetNamespace, String localName)
          Serialize a DataObject to the specified xml element in text xml
static Object unwrapPrimitives(Object obj)
           
static boolean validateBuiltinType(String javaType, QName qname)
          Check whether a java class is supported The builtin type includes all the default type mappings specified in the SDO Spec
static boolean validateSupportedType(commonj.sdo.helper.HelperContext hc, String javaType, QName qname)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NS_XMLNS

public static final String NS_XMLNS
See Also:
Constant Field Values

NS_WSDL

public static final String NS_WSDL
See Also:
Constant Field Values

QNAME_SCHEMA

public static final QName QNAME_SCHEMA

transformerFactory

static TransformerFactory transformerFactory

dbf

static DocumentBuilderFactory dbf
Constructor Detail

SDOUtils

public SDOUtils()
Method Detail

newTransformer

public static Transformer newTransformer()

newDocumentBuilder

public static DocumentBuilder newDocumentBuilder()

sdoToDom

public static Element sdoToDom(commonj.sdo.helper.HelperContext hc,
                               commonj.sdo.DataObject obj,
                               String targetNamespace,
                               String localName)
                        throws ParserConfigurationException,
                               IOException
Serialize a DataObject to the specified element Per bug 6120620,, we use only GMT timezone

Throws:
ParserConfigurationException
IOException

sdoToXML

public static Source sdoToXML(commonj.sdo.helper.HelperContext hc,
                              commonj.sdo.DataObject obj,
                              String targetNamespace,
                              String localName)
                       throws ParserConfigurationException,
                              IOException
Serialize a DataObject to the specified xml element in text xml

Parameters:
hc -
obj -
targetNamespace -
localName -
Returns:
Throws:
ParserConfigurationException
IOException

registerSDOContext

public static void registerSDOContext(commonj.sdo.helper.HelperContext context,
                                      List<Source> schemas)
Register the types defined in the given schema with the given sdo helper context

Parameters:
context -
schemas -

getSchemaClosureFromWSDL

public static List<Source> getSchemaClosureFromWSDL(Source wsdlSource)

createDOM

public static Document createDOM(Source wsdlSource)

getMetadataClosure

public static Map<String,Source> getMetadataClosure(List<Source> schemas)

unwrapPrimitives

public static Object unwrapPrimitives(Object obj)

printDOM

public static void printDOM(Source src)

dom2String

public static String dom2String(DOMSource domSrc)
                         throws TransformerConfigurationException,
                                TransformerException
Throws:
TransformerConfigurationException
TransformerException

printXMLReader

public static void printXMLReader(javax.xml.stream.XMLStreamReader xml)

getPropertyElementName

public static QName getPropertyElementName(commonj.sdo.helper.HelperContext context,
                                           commonj.sdo.Property p)
get the element name represented by this property

Parameters:
context -
p -
Returns:

defineSchema

public static List defineSchema(commonj.sdo.helper.HelperContext hc,
                                File f)
                         throws Exception
Throws:
Exception

newDocument

public static Document newDocument()

validateBuiltinType

public static boolean validateBuiltinType(String javaType,
                                          QName qname)
Check whether a java class is supported The builtin type includes all the default type mappings specified in the SDO Spec

Parameters:
javaType -
qname -
Returns:

validateSupportedType

public static boolean validateSupportedType(commonj.sdo.helper.HelperContext hc,
                                            String javaType,
                                            QName qname)

getSchemas

public static Set<SchemaInfo> getSchemas(File f)
                                  throws Exception
Throws:
Exception

getSchemas

public static Set<SchemaInfo> getSchemas(String filePath)
                                  throws Exception
Throws:
Exception


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.