public Document getInitializedDocument() throws SAXException { if (document == null) { try { document = xmlPlatform.createDocument(); nodes.add(document); } catch (Exception e) { throw new SAXException(e); } } return document; }
public Document getInitializedDocument() throws SAXException { if (document == null) { try { document = xmlPlatform.createDocument(); nodes.add(document); } catch (Exception e) { throw new SAXException(e); } } return document; }
public void startDocument() throws SAXException { try { document = xmlPlatform.createDocument(); nodes.add(document); } catch (Exception e) { throw new SAXException(e); } }
public void startDocument() throws SAXException { try { document = xmlPlatform.createDocument(); nodes.add(document); } catch (Exception e) { throw new SAXException(e); } }
public void startDocument() throws SAXException { try { document = xmlPlatform.createDocument(); nodes.add(document); } catch (Exception e) { throw new SAXException(e); } }
public Document getInitializedDocument() throws SAXException { if (document == null) { try { document = xmlPlatform.createDocument(); nodes.add(document); } catch (Exception e) { throw new SAXException(e); } } return document; }
/** * INTERNAL: * Default constructor. */ public NodeRecord() { super(); XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); document = xmlPlatform.createDocument(); node = document; }
/** * INTERNAL: * Creates a new Document and returns the root element of that document */ public Node createNewDocument(String defaultRootElementName, String namespaceURI) { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); Document document = xmlPlatform.createDocument(); if (defaultRootElementName == null || defaultRootElementName.length() == 0) { DocumentFragment fragment = document.createDocumentFragment(); return fragment; } else { Node rootNode = document.createElementNS(namespaceURI, defaultRootElementName); document.appendChild(rootNode); return document.getDocumentElement(); } }
/** * INTERNAL: * Default constructor. */ public NodeRecord() { super(); XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); document = xmlPlatform.createDocument(); node = document; }
/** * INTERNAL: * Creates a new Document and returns the root element of that document */ public Node createNewDocument(String defaultRootElementName, String namespaceURI) { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); Document document = xmlPlatform.createDocument(); if (defaultRootElementName == null || defaultRootElementName.length() == 0) { DocumentFragment fragment = document.createDocumentFragment(); return fragment; } else { Node rootNode = document.createElementNS(namespaceURI, defaultRootElementName); document.appendChild(rootNode); return document.getDocumentElement(); } }
/** * INTERNAL: * Default constructor. */ public NodeRecord() { super(); XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); document = xmlPlatform.createDocument(); node = document; }
/** * INTERNAL: * Creates a new Document and returns the root element of that document */ public Node createNewDocument(String defaultRootElementName, String namespaceURI) { XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); Document document = xmlPlatform.createDocument(); if (defaultRootElementName == null || defaultRootElementName.length() == 0) { DocumentFragment fragment = document.createDocumentFragment(); return fragment; } else { Node rootNode = document.createElementNS(namespaceURI, defaultRootElementName); document.appendChild(rootNode); return document.getDocumentElement(); } }
/** * Validate the given object. * @param object A single object to validate * @return true if this is a valid object, otherwise false */ public boolean validate(Object object) throws XMLMarshalException { if (object == null) { throw XMLMarshalException.nullArgumentException(); } try { // Create a new XML Record using the object's class name (not fully qualified) as the root String name = ((XMLDescriptor)xmlContext.getSession(object).getDescriptor(object)).getDefaultRootElement(); if (name == null) { String qualifiedName = object.getClass().getName(); int idx = qualifiedName.lastIndexOf('.'); name = qualifiedName.substring(idx + 1); } XMLDescriptor descriptor = marshaller.getDescriptor(object); XMLRoot root = new XMLRoot(); root.setObject(object); root.setLocalName(name); XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); Document doc = xmlPlatform.createDocument(); marshaller.marshal(root, doc); return xmlPlatform.validate(doc.getDocumentElement(), descriptor, getErrorHandler()); } catch (XMLPlatformException e) { throw XMLMarshalException.validateException(e); } }
/** * Validate the given object. * @param object A single object to validate * @return true if this is a valid object, otherwise false */ public boolean validate(Object object) throws XMLMarshalException { if (object == null) { throw XMLMarshalException.nullArgumentException(); } try { // Create a new XML Record using the object's class name (not fully qualified) as the root String name = ((XMLDescriptor)xmlContext.getSession(object).getDescriptor(object)).getDefaultRootElement(); if (name == null) { String qualifiedName = object.getClass().getName(); int idx = qualifiedName.lastIndexOf('.'); name = qualifiedName.substring(idx + 1); } XMLDescriptor descriptor = marshaller.getDescriptor(object); Root root = new Root(); root.setObject(object); root.setLocalName(name); XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); Document doc = xmlPlatform.createDocument(); marshaller.marshal(root, doc); return xmlPlatform.validate(doc.getDocumentElement(), descriptor, getErrorHandler()); } catch (XMLPlatformException e) { throw XMLMarshalException.validateException(e); } }
/** * Validate the given object. * @param object A single object to validate * @return true if this is a valid object, otherwise false */ public boolean validate(Object object) throws XMLMarshalException { if (object == null) { throw XMLMarshalException.nullArgumentException(); } try { // Create a new XML Record using the object's class name (not fully qualified) as the root String name = ((XMLDescriptor)xmlContext.getSession(object).getDescriptor(object)).getDefaultRootElement(); if (name == null) { String qualifiedName = object.getClass().getName(); int idx = qualifiedName.lastIndexOf('.'); name = qualifiedName.substring(idx + 1); } XMLDescriptor descriptor = marshaller.getDescriptor(object); Root root = new Root(); root.setObject(object); root.setLocalName(name); XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); Document doc = xmlPlatform.createDocument(); marshaller.marshal(root, doc); return xmlPlatform.validate(doc.getDocumentElement(), descriptor, getErrorHandler()); } catch (XMLPlatformException e) { throw XMLMarshalException.validateException(e); } }
private Object buildFragment(Property property, SDODataObject parentObject, SDODataObject value) { //build an XML Fragment from this SDO XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); XMLMarshaller xmlMarshaller = ((SDOXMLHelper)helperContext.getXMLHelper()).getXmlContext().createMarshaller(); Document doc = xmlPlatform.createDocument(); XMLRoot root = new XMLRoot(); root.setObject(value); root.setLocalName(property.getName()); if(((SDOProperty)property).isNamespaceQualified()){ root.setNamespaceURI(parentObject.getType().getURI()); } xmlMarshaller.marshal(root, doc); return doc.getDocumentElement(); } }
private Object buildFragment(Property property, SDODataObject parentObject, SDODataObject value) { //build an XML Fragment from this SDO XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); XMLMarshaller xmlMarshaller = ((SDOXMLHelper)helperContext.getXMLHelper()).getXmlContext().createMarshaller(); Document doc = xmlPlatform.createDocument(); XMLRoot root = new XMLRoot(); root.setObject(value); root.setLocalName(property.getName()); if(((SDOProperty)property).isNamespaceQualified()){ root.setNamespaceURI(parentObject.getType().getURI()); } xmlMarshaller.marshal(root, doc); return doc.getDocumentElement(); } }
Document document = XMLPlatformFactory.getInstance().getXMLPlatform().createDocument(); Element csNode = null; List modifiedItems = changeSummary.getModified();
Document document = XMLPlatformFactory.getInstance().getXMLPlatform().createDocument(); Element csNode = null; List modifiedItems = changeSummary.getModified();