Package org.bifrost.xmlio.config

Examples of org.bifrost.xmlio.config.ObjectMap


    pmap.setConverter(dconv);
    plist.add(pmap);
    pmap = new PropertyMap("calendar");
    pmap.setConverter(new GregorianCalendarConverter());
    plist.add(pmap);
    ObjectMap omap = new ObjectMap("TestHelperDate", "TestHelperDate", plist);
    config.addObjectMap(omap);
   
    CharArrayWriter output = new CharArrayWriter();
    assertNotNull(output);
    TestHelperDate helper = new TestHelperDate();
View Full Code Here


   */
  public void testSimpleAttributes()
  {
    XmlIOConfig config = XmlIOConfig.getInstance();
    // Set up mapping
    ObjectMap oMap =
      ObjectMap.createFromClassAsAttributes(TestHelperSimple.class);
    config.addObjectMap(oMap);

    CharArrayWriter output = new CharArrayWriter();
    assertNotNull(output);
View Full Code Here

   */
  public void testMixedAttributes()
  {
    XmlIOConfig config = XmlIOConfig.getInstance();
    // Set up mapping
    ObjectMap oMap = ObjectMap.createFromClass(TestHelperSimple.class);
    PropertyMap pMap = oMap.getPropertyMapFromName("number");
    pMap.setWriteAsAttribute(true);
    config.addObjectMap(oMap);

    CharArrayWriter output = new CharArrayWriter();
    assertNotNull(output);
View Full Code Here

    XmlIOConfig config = XmlIOConfig.getInstance();
    // Set up mapping
    List list = new LinkedList();
    list.add(new PropertyMap("a", "string"));
    list.add(new PropertyMap("b", "number"));
    ObjectMap oMap = new ObjectMap("obj", "TestHelperSimple", list);
    config.addObjectMap(oMap);
    list = new LinkedList();
    list.add(new PropertyMap("obj", "testHelperSimple"));
    oMap = new ObjectMap("TestHelperComplex", "TestHelperComplex", list);
    config.addObjectMap(oMap);
    // Create the object graph
    TestHelperComplex helper = new TestHelperComplex();
    assertNotNull(helper);
    TestHelperSimple simple = new TestHelperSimple(222l, "aaa");
View Full Code Here

   * the properties of the inner objects are output as XML attributes.
   */
  public void testComplexAttributes()
  {
    XmlIOConfig config = XmlIOConfig.getInstance();
    ObjectMap oMap =
      ObjectMap.createFromClassAsAttributes(TestHelperSimple.class);
    config.addObjectMap(oMap);

    CharArrayWriter output = new CharArrayWriter();
    assertNotNull(output);
View Full Code Here

    XmlIOConfig config = XmlIOConfig.getInstance();
    // Set up mapping
    List list = new LinkedList();
    list.add(new PropertyMap("a", "string"));
    list.add(new PropertyMap("b", "number"));
    ObjectMap oMap = new ObjectMap("obj", "TestHelperSimple", list);
    config.addObjectMap(oMap);
    list = new LinkedList();
    list.add(new PropertyMap("obj", "TestHelperSimple"));
    oMap = new ObjectMap("TestHelperComplex", "TestHelperComplex", list);
    config.addObjectMap(oMap);
    InputStream reader = new ByteArrayInputStream(configString.getBytes());
    XmlReader xmlReader = null;
    try
    {
View Full Code Here

    String configString = createXml(TEST_OBJECT_MAPPING);
    XmlIOConfig config = XmlIOConfig.getInstance();
    // Set up mapping
    List list = new LinkedList();
    list.add(new PropertyMap("obj", "TestHelperSimple"));
    ObjectMap oMap = new ObjectMap("TestHelperComplex", "TestHelperComplex", list);
    config.addObjectMap(oMap);
    InputStream reader = new ByteArrayInputStream(configString.getBytes());
    XmlReader xmlReader = null;
    try
    {
View Full Code Here

    XmlIOConfig config = XmlIOConfig.getInstance();
    // Set up mapping
    List list = new LinkedList();
    list.add(new PropertyMap("a", "string"));
    list.add(new PropertyMap("b", "number"));
    ObjectMap oMap = new ObjectMap("TestHelperSimple", "TestHelperSimple", list);
    config.addObjectMap(oMap);
    InputStream reader = new ByteArrayInputStream(configString.getBytes());
    XmlReader xmlReader = null;
    try
    {
View Full Code Here

    pmap.setConverter(dconv);
    plist.add(pmap);
    pmap = new PropertyMap("endTime");
    pmap.setConverter(dconv);
    plist.add(pmap);
    ObjectMap omap = new ObjectMap("TestHelperDate", "TestHelperDate", plist);
    config.addObjectMap(omap);

    try
    {
      xmlReader = new XmlReader(reader, "org.bifrost.xmlio.test.helpers");
View Full Code Here

      result = config.getPropertyMapByAlias(xmlName).getPropertyName();

    if (result == null && className != null)
    {
      // See if this object name is mapped
      ObjectMap oMap = config.getObjectMapByName(className);
      if (oMap == null)
      {
        className = StringHelper.capitalizeFirst(className);
        oMap = config.getObjectMapByName(className);
      }
      if (oMap != null && oMap.getPropertyMapFromAlias(xmlName) != null)
        result = oMap.getPropertyMapFromAlias(xmlName).getPropertyName();
    }

    if (result == null)
      result = xmlName;
   
View Full Code Here

TOP

Related Classes of org.bifrost.xmlio.config.ObjectMap

Copyright © 2018 www.massapicom. 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.