Examples of MappingElement


Examples of net.sourceforge.syncyoursecrets.xmlmapping.MappingElement

    if (obj instanceof StringElement) {
      StringElement stringElement = (StringElement) obj;
      return stringElement.getElementName();
    }
    if (obj instanceof MappingElement) {
      MappingElement element = (MappingElement) obj;
      return element.getName();
    }

    return obj.toString();
  }
View Full Code Here

Examples of org.jibx.binding.model.MappingElement

        JavaClass clas = cf.getRawClass();
        if (m_verbose) {
            System.out.println("\nBuilding mapping definition for " +
                clas.getClassName());
        }
        MappingElementBase element = new MappingElement();
        element.setAbstract(abstr || clas.isAbstract() || clas.isInterface());
        String name = clas.getClassName();
        element.setClassName(name);
        if (abstr) {
            element.setAbstract(true);
        } else {
            element.setName((String)m_mappedNames.get(name));
        }
        m_structureStack.push(name);
        defineStructure(cf, element);
        m_structureStack.pop();
        return element;
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

*/
public class FakeXMLMetadata {
   
    public static MappingDocument docWithExcluded() {
        MappingDocument doc = new MappingDocument(true);
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$

        MappingElement n1 = root.addChildElement(new MappingElement("element1", "nis_element1")); //$NON-NLS-1$ //$NON-NLS-2$
        n1.setSource("mappingclass1"); //$NON-NLS-1$
       
        MappingElement n1r = n1.addChildElement(new MappingRecursiveElement("element1", "mappingclass1")); //$NON-NLS-1$ //$NON-NLS-2$
        n1r.setNameInSource("nis_element1"); //$NON-NLS-1$
        n1r.setExclude(true);
        MappingElement n1r2 = n1.addChildElement(new MappingRecursiveElement("element1", "mappingclass1")); //$NON-NLS-1$ //$NON-NLS-2$
        n1r2.addChildElement(new MappingElement("donotdelete", "nis_donotdelete")).setExclude(true); //$NON-NLS-1$ //$NON-NLS-2$
       
       
        MappingChoiceNode choice1 = root.addChoiceNode(new MappingChoiceNode());
        MappingCriteriaNode crit1 = choice1.addCriteriaNode(new MappingCriteriaNode("one==one", false)); //$NON-NLS-1$
        crit1.addChildElement(new MappingElement("c1_Criteria_1", "nis_c1_Criteria_1")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingCriteriaNode crit2 = choice1.addCriteriaNode(new MappingCriteriaNode());
        crit2.addChildElement(new MappingElement("c1_Criteria_2", "nis_c1_Criteria_2")); //$NON-NLS-1$ //$NON-NLS-2$
        choice1.setExclude(true);

        MappingChoiceNode choice2 = root.addChoiceNode(new MappingChoiceNode());
       
        MappingCriteriaNode crit21 = choice2.addCriteriaNode(new MappingCriteriaNode("one==one", false)); //$NON-NLS-1$
        crit21.addChildElement(new MappingElement("c2_Criteria_1")); //$NON-NLS-1$

        MappingCriteriaNode crit22 = choice2.addCriteriaNode(new MappingCriteriaNode());
        crit22.addChildElement(new MappingElement("c2_Criteria_2")).setExclude(true); //$NON-NLS-1$
       
        MappingSequenceNode seq1 = root.addSequenceNode(new MappingSequenceNode());
        seq1.addChildElement(new MappingElement("seq1_element1", "nis_seq1_element1")) //$NON-NLS-1$ //$NON-NLS-2$
            .setExclude(true);
        MappingElement seq1_e2 = seq1.addChildElement(new MappingElement("seq1_element2", "nis_seq1_element2")); //$NON-NLS-1$ //$NON-NLS-2$
        seq1_e2.setNillable(true);
               
        MappingElement n2 = root.addChildElement(new MappingElement("element2")); //$NON-NLS-1$
        n2.addCommentNode(new MappingCommentNode("this is comment")); //$NON-NLS-1$
        MappingAttribute attr1 = new MappingAttribute("element2_attribute1"); //$NON-NLS-1$
        n2.addAttribute(attr1);       
        attr1.setExclude(true);
       
        MappingAttribute attr2 = new MappingAttribute("element2_attribute2", "nis_element2_attribute2"); //$NON-NLS-1$ //$NON-NLS-2$       
        n2.addAttribute(attr2);
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

    private static MappingDocument doc1() {
        // DOC 1
        MappingDocument doc = new MappingDocument(false);
       
        MappingElement node= doc.addChildElement(new MappingElement("a0")); //$NON-NLS-1$
       
        MappingElement sourceNode = node.addChildElement(new MappingElement("a1")); //$NON-NLS-1$
        sourceNode.setSource("vm1.g1"); //$NON-NLS-1$
       
        sourceNode.addStagingTable("tm1.g1"); //$NON-NLS-1$

        sourceNode.addChildElement(new MappingElement("a1", "vm1.g1.e1")); //$NON-NLS-1$ //$NON-NLS-2$
        sourceNode.addChildElement(new MappingElement("b1", "vm1.g1.e2")); //$NON-NLS-1$ //$NON-NLS-2$
        sourceNode.addChildElement(new MappingElement("c1", "vm1.g1.e3")); //$NON-NLS-1$ //$NON-NLS-2$
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

*/
public class TestHandleNillableNode extends TestCase {
   
    public void testNillableNode() {
        MappingDocument doc = FakeXMLMetadata.docWithExcluded();
        MappingElement root = (MappingElement)doc.getRootNode();
       
        Properties names = root.getNamespacesAsProperties();
        assertFalse(names.containsKey("xsi"));//$NON-NLS-1$
       
        HandleNillableVisitor.execute(doc);
       
        names = root.getNamespacesAsProperties();
        assertTrue(names.containsKey("xsi"));//$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

        return doc;
    }

    private static MappingDocument doc2() {
        MappingDocument doc = new MappingDocument(false);
        MappingElement A1 = doc.addChildElement(new MappingElement("a1", "vm1.g1.e1")); //$NON-NLS-1$ //$NON-NLS-2$
        A1.setSource("vm1.g1"); //$NON-NLS-1$
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

    }

    private static MappingDocument docTestConvertCriteriaWithAttribute() {
        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
        root.setSource("vm1.g1"); //$NON-NLS-1$

        root.addChildElement(new MappingElement("myElement", "vm1.g1.e2")); //$NON-NLS-1$ //$NON-NLS-2$
        root.addAttribute(new MappingAttribute("myAttribute", "vm1.g1.e1")); //$NON-NLS-1$ //$NON-NLS-2$
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

    }

    private static MappingDocument docTestConvertCriteriaWithAttribute2() {
        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
        root.setSource("vm1.g1"); //$NON-NLS-1$
        root.addAttribute(new MappingAttribute("myAttribute", "vm1.g1.e1")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingSequenceNode seq = root.addSequenceNode(new MappingSequenceNode());
        seq.addChildElement(new MappingElement("myElement", "vm1.g1.e2")); //$NON-NLS-1$ //$NON-NLS-2$
        return doc;
    }   
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

     * group but is not in it's scope
     */
    private static MappingDocument doc3() {
        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$

        MappingElement n1 = root.addChildElement(new MappingElement("n1")); //$NON-NLS-1$
        n1.setSource("vm1.g1"); //$NON-NLS-1$
       
        MappingElement m1 = n1.addChildElement(new MappingElement("m1")); //$NON-NLS-1$
       
        MappingElement n2 = m1.addChildElement(new MappingElement("n2")); //$NON-NLS-1$
        n2.setSource("vm1.g2"); //$NON-NLS-1$
        n2.addStagingTable("tm1.g1"); //$NON-NLS-1$

        n2.addChildElement(new MappingElement("leaf1", "vm1.g1.e1")); //$NON-NLS-1$ //$NON-NLS-2$
       
        return doc;
    }
View Full Code Here

Examples of org.teiid.query.mapping.xml.MappingElement

    private static MappingDocument doc4() {
       
        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$

        MappingElement n4a = root.addChildElement(new MappingElement("n4a")); //$NON-NLS-1$
        n4a.setMaxOccurrs(-1);
        n4a.setSource("vm1.g1"); //$NON-NLS-1$
        n4a.addStagingTable("tm1.g1"); //$NON-NLS-1$
        n4a.addChildElement(new MappingElement("n4b", "vm1.g1.e1")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingElement n4c = n4a.addChildElement(new MappingElement("n4c")); //$NON-NLS-1$
        n4c.setMaxOccurrs(-1);
        n4c.setSource("vm1.g2");         //$NON-NLS-1$

        //this node can't be used for anything but searching through mapping doc for this property
        MappingElement fake = n4a.addChildElement(new MappingElement("fake")); //$NON-NLS-1$
        fake.setSource("fakeResultSet"); //$NON-NLS-1$
       
        n4c.addChildElement(new MappingElement("n4d", "vm1.g2.e1")); //$NON-NLS-1$ //$NON-NLS-2$

        MappingElement n4e = n4c.addChildElement(new MappingElement("n4e")); //$NON-NLS-1$
        n4e.setSource("vm1.g3"); //$NON-NLS-1$
        n4e.setMaxOccurrs(-1);
        n4e.addChildElement(new MappingElement("n4f", "vm1.g3.e1")); //$NON-NLS-1$ //$NON-NLS-2$
       
        return doc;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.