Examples of ObjectMap


Examples of org.bifrost.xmlio.config.ObjectMap

    }

    // See if this property is actually an object in the mapping
    if (config.getObjectMapByAlias(alias) != null)
    {
      ObjectMap map = config.getObjectMapByAlias(alias);
      logger.fine("Found map for " + alias + " as an object (" +
          map.getName() + ")");
      result = map.getName();
      return result;
    }

    if (classAlias == null)
    {
      logger.fine("No class alias name passed");
      return result;
    }

    // See if the current object is in the mapping and if this property is
    // also mapped...
    if (config.getObjectMapByAlias(classAlias) != null)
    {
      ObjectMap map = config.getObjectMapByAlias(classAlias);
      if (map != null && map.getPropertyMapFromAlias(alias) != null)
      {
        PropertyMap pMap = map.getPropertyMapFromAlias(alias);
        if (pMap.getPropertyName() != null)
        {
          logger.fine("Found property map for " + alias +
              " as part of map for " + classAlias);
          result = pMap.getPropertyName();
View Full Code Here

Examples of org.bifrost.xmlio.config.ObjectMap

   * Set up some simple property mappings for a specific object.
   *
   */
  private void configSimpleTestFromObject()
  {
    ObjectMap oMap = new ObjectMap();
    oMap.setName("TestHelperSimple");
    oMap.setXmlName("TestHelperSimple");
    PropertyMap map = new PropertyMap();
    map.setPropertyXmlName("theString");
    map.setPropertyName("string");
    map.setPropertyType(String.class);
    oMap.addPropertyMap(map);
   
    map = new PropertyMap();
    map.setPropertyXmlName("theNumber");
    map.setPropertyName("number");
    map.setPropertyType(Long.class);
    oMap.addPropertyMap(map);
    config.addObjectMap(oMap);
  }
View Full Code Here

Examples of org.bifrost.xmlio.config.ObjectMap

  }
 
  public void testSimpleCreateFromClass()
  {
    assertNull(ObjectMap.createFromClass(null));
    ObjectMap om = ObjectMap.createFromClass(TestHelperObjectMapEmpty.class);
    assertNotNull(om);
    String thisName =
      nameWithoutPackage(TestHelperObjectMapEmpty.class.getName());
    assertEquals(thisName, om.getName());
    assertEquals(thisName, om.getXmlName());
    assertNotNull(om.getPropertyMap());
    assertEquals(om.getPropertyMap().size(), 0);
  }
View Full Code Here

Examples of org.bifrost.xmlio.config.ObjectMap

  }
 
  public void testCreateFromClass()
  {
    assertNull(ObjectMap.createFromClass(null));
    ObjectMap om = ObjectMap.createFromClass(TestHelperObjectMap.class);
    assertNotNull(om);
    String thisName = nameWithoutPackage(TestHelperObjectMap.class.getName());
    assertEquals(thisName, om.getName());
    assertEquals(thisName, om.getXmlName());
    assertNotNull(om.getPropertyMap());
    assertNull(om.getPropertyMapFromAlias("fooBar"));
    assertNotNull(om.getPropertyMapFromAlias("id"));
    assertNotNull(om.getPropertyMapFromAlias("name"));
    assertNotNull(om.getPropertyMapFromAlias("age"));
    assertNotNull(om.getPropertyMapFromAlias("birthday"));
  }
View Full Code Here

Examples of org.bifrost.xmlio.config.ObjectMap

  }

  public void testPropertyMap()
  {
    assertNull(ObjectMap.createFromClass(null));
    ObjectMap om = ObjectMap.createFromClass(TestHelperObjectMap.class);
    assertNotNull(om);
    assertNotNull(om.getPropertyMapFromAlias("id"));
    PropertyMap pm = om.getPropertyMapFromAlias("id");
    assertTrue("id".equals(pm.getPropertyName()));
    assertTrue("id".equals(pm.getPropertyXmlName()));
    assertTrue("long".equals(pm.getPropertyType().getName()));
  }
View Full Code Here

Examples of org.bifrost.xmlio.config.ObjectMap

   
    String fqClassName = object.getClass().getName();
    String className = StringHelper.classNameWithoutPackage(fqClassName);

    // Look up the object via it's short name
    ObjectMap oMap = config.getObjectMapByName(className);
    // If not found, look for it via it's fully qualified name
    if (oMap == null)
      oMap = config.getObjectMapByName(fqClassName);
    // If not found, create a mapping from the object's class
    if (oMap == null)
      oMap = config.addClassAsMappedObject(object.getClass());
   
    if (oMap == null)
      throw new XmlException ("Cannot find nor create definition for " + className);

    className = oMap.getXmlName();
    if (dashedNames == true)
      className = StringHelper.capitalsToDashes(className);
   
    logger.fine("Writing object " + oMap.getName() + " as <" + className + ">");

    try
    {
      if (beautify == true)
        outputIndent(indentLevel, writer);
View Full Code Here

Examples of org.eclipse.core.internal.utils.ObjectMap

    }
  }

  private void readSyncInfo(IPath path, DataInputStream input, List readPartners) throws IOException, CoreException {
    int size = input.readInt();
    ObjectMap table = new ObjectMap(size);
    for (int i = 0; i < size; i++) {
      QualifiedName name = null;
      int type = input.readInt();
      switch (type) {
        case QNAME :
          String qualifier = input.readUTF();
          String local = input.readUTF();
          name = new QualifiedName(qualifier, local);
          readPartners.add(name);
          break;
        case INDEX :
          name = (QualifiedName) readPartners.get(input.readInt());
          break;
        default :
          //if we get here then the sync info file is corrupt
          String msg = NLS.bind(Messages.resources_readSync, path == null ? "" : path.toString()); //$NON-NLS-1$
          throw new ResourceException(IResourceStatus.FAILED_READ_METADATA, path, msg, null);
      }
      // read the bytes
      int length = input.readInt();
      byte[] bytes = new byte[length];
      input.readFully(bytes);
      // put them in the table
      table.put(name, bytes);
    }
    // set the table on the resource info
    ResourceInfo info = workspace.getResourceInfo(path, true, false);
    if (info == null)
      return;
View Full Code Here

Examples of org.red5.io.utils.ObjectMap

    public void onStreamEvent( Notify notify ) {

        logger.debug( "onStreamEvent " + notify );

        ObjectMap map = (ObjectMap) notify.getCall().getArguments()[ 0 ];
        String code = (String) map.get( "code" );

        if ( StatusCodes.NS_PUBLISH_START.equals( code ) ) {
            logger.debug( "onStreamEvent Publish start" );
            startPublish = true;
        }
View Full Code Here

Examples of org.red5.io.utils.ObjectMap

    public void onStreamEvent( Notify notify ) {

        logger.debug( "onStreamEvent " + notify );

        ObjectMap map = (ObjectMap) notify.getCall().getArguments()[ 0 ];
        String code = (String) map.get( "code" );

        if ( StatusCodes.NS_PUBLISH_START.equals( code ) ) {
            logger.debug( "onStreamEvent Publish start" );
            startPublish = true;
        }
View Full Code Here

Examples of org.red5.io.utils.ObjectMap

    public void onStreamEvent( Notify notify ) {

        //logger.debug( "onStreamEvent " + notify );

        ObjectMap map = (ObjectMap) notify.getCall().getArguments()[ 0 ];
        String code = (String) map.get( "code" );

        if ( StatusCodes.NS_PUBLISH_START.equals( code ) ) {
            //logger.debug( "onStreamEvent Publish start" );
            startPublish = true;
        }
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.