Search in sources :

Example 96 with XMLRoot

use of org.eclipse.persistence.oxm.XMLRoot in project eclipselink by eclipse-ee4j.

the class XMLRootComplexNoNamespaceResolverTestCases method getReadControlObject.

@Override
public Object getReadControlObject() {
    Person peep = new Person();
    peep.setName(CONTROL_PERSON_NAME);
    XMLRoot xmlRoot = new XMLRoot();
    xmlRoot.setLocalName(NS0_CONTROL_ELEMENT_NAME);
    xmlRoot.setNamespaceURI(CONTROL_NAMESPACE_URI);
    xmlRoot.setObject(peep);
    return xmlRoot;
}
Also used : XMLRoot(org.eclipse.persistence.oxm.XMLRoot) Person(org.eclipse.persistence.testing.oxm.xmlroot.Person)

Example 97 with XMLRoot

use of org.eclipse.persistence.oxm.XMLRoot in project eclipselink by eclipse-ee4j.

the class XMLRootComplexNoNamespaceResolverTestCases method getWriteControlObject.

@Override
public Object getWriteControlObject() {
    Person peep = new Person();
    peep.setName(CONTROL_PERSON_NAME);
    XMLRoot xmlRoot = new XMLRoot();
    xmlRoot.setLocalName(NS0_CONTROL_ELEMENT_NAME_NO_PREFIX);
    xmlRoot.setNamespaceURI(CONTROL_NAMESPACE_URI);
    xmlRoot.setObject(peep);
    return xmlRoot;
}
Also used : XMLRoot(org.eclipse.persistence.oxm.XMLRoot) Person(org.eclipse.persistence.testing.oxm.xmlroot.Person)

Example 98 with XMLRoot

use of org.eclipse.persistence.oxm.XMLRoot in project eclipselink by eclipse-ee4j.

the class XMLRootComplexNoPrefixTestCases method getReadControlObject.

@Override
public Object getReadControlObject() {
    Person peep = new Person();
    peep.setName(CONTROL_PERSON_NAME);
    XMLRoot xmlRoot = new XMLRoot();
    xmlRoot.setLocalName(CONTROL_ELEMENT_NAME);
    xmlRoot.setNamespaceURI(CONTROL_NAMESPACE_URI);
    xmlRoot.setObject(peep);
    return xmlRoot;
}
Also used : XMLRoot(org.eclipse.persistence.oxm.XMLRoot) Person(org.eclipse.persistence.testing.oxm.xmlroot.Person)

Example 99 with XMLRoot

use of org.eclipse.persistence.oxm.XMLRoot in project eclipselink by eclipse-ee4j.

the class AnyObjectKeepAllAsElementTestCases method getWriteControlObject.

@Override
public Object getWriteControlObject() {
    Child child = new Child();
    child.setContent(TEXT);
    XMLRoot xmlRoot = new XMLRoot();
    xmlRoot.setLocalName(CHILD);
    xmlRoot.setObject(child);
    RootKeepAsElement root = new RootKeepAsElement();
    root.setT1(xmlRoot);
    return root;
}
Also used : XMLRoot(org.eclipse.persistence.oxm.XMLRoot)

Example 100 with XMLRoot

use of org.eclipse.persistence.oxm.XMLRoot in project eclipselink by eclipse-ee4j.

the class DefaultNamespaceXMLRootTestCases method getWriteControlObject.

@Override
public Object getWriteControlObject() {
    XMLRoot root = new XMLRoot();
    root.setLocalName("employee");
    root.setNamespaceURI("http://www.example.com/EMPLOYEE");
    Employee employee = (Employee) getControlObject();
    root.setObject(employee);
    return root;
}
Also used : Employee(org.eclipse.persistence.testing.oxm.mappings.namespaces.Employee) XMLRoot(org.eclipse.persistence.oxm.XMLRoot)

Aggregations

XMLRoot (org.eclipse.persistence.oxm.XMLRoot)126 XMLDescriptor (org.eclipse.persistence.oxm.XMLDescriptor)34 Document (org.w3c.dom.Document)28 SAXException (org.xml.sax.SAXException)17 StringWriter (java.io.StringWriter)16 Person (org.eclipse.persistence.testing.oxm.xmlroot.Person)13 IOException (java.io.IOException)12 ArrayList (java.util.ArrayList)11 Vector (java.util.Vector)11 Node (org.w3c.dom.Node)11 QName (javax.xml.namespace.QName)10 XMLOutputFactory (javax.xml.stream.XMLOutputFactory)10 Element (org.w3c.dom.Element)10 StringReader (java.io.StringReader)9 InputSource (org.xml.sax.InputSource)9 DataObject (commonj.sdo.DataObject)8 JAXBException (jakarta.xml.bind.JAXBException)8 InputStream (java.io.InputStream)8 MalformedURLException (java.net.MalformedURLException)8 XMLStreamException (javax.xml.stream.XMLStreamException)8