Examples of InfoNode


Examples of org.freezedry.persistence.tree.InfoNode

    }
    if( persistName == null || persistName.isEmpty() )
    {
      persistName = fieldName;
    }
    final InfoNode node = InfoNode.createCompoundNode( fieldName, persistName, clazz );
   
    // set the entry, key, and value persistence names to the default value of the annotation. if the
    // map field is annotated, then we over write the default values with the annotated values.
    // does the class have a @PersistMap( keyPersistName = "xxxx", valuePersistName = "yyyy", entryPeristName = "zzzz" )
    String entryPersistName = PersistMap.ENTRY_PERSIST_NAME;
    String keyPersistName = PersistMap.KEY_PERSIST_NAME;
    String valuePersistName = PersistMap.VALUE_PERSIST_NAME;
    try
    {
      final Field field = ReflectionUtils.getDeclaredField( containingClass, fieldName );
      final PersistMap mapAnnotation = field.getAnnotation( PersistMap.class );
      if( mapAnnotation != null )
      {
        if( !mapAnnotation.entryPersistName().isEmpty() )
        {
          entryPersistName = mapAnnotation.entryPersistName();
        }
        if( !mapAnnotation.keyPersistName().isEmpty() )
        {
          keyPersistName = mapAnnotation.keyPersistName();
        }
        if( !mapAnnotation.valuePersistName().isEmpty() )
        {
          valuePersistName = mapAnnotation.valuePersistName();
        }
      }
    }
    catch( ReflectiveOperationException e )
    {
      final StringBuffer message = new StringBuffer();
      message.append( "Field not found in containing class:" + Constants.NEW_LINE );
      message.append( "  Containing class: " + containingClass.getName() + Constants.NEW_LINE );
      message.append( "  Field name: " + fieldName + Constants.NEW_LINE );
      LOGGER.info( message.toString() );
    }
   
    // run through the Map entries, recursively calling createNode(...) to create
    // the appropriate node which to add to the newly created compound node.
    for( Map.Entry< ?, ? > entry : ((Map< ?, ? >)object).entrySet() )
    {
      // create the map entry node
      final InfoNode entryNode = InfoNode.createCompoundNode( "", entryPersistName, entry.getClass() );
     
      // create the key node and add it to the entry node
      entryNode.addChild( createNode( clazz, entry.getKey(), keyPersistName ) );
     
      // create the value node and add it to the entry node
      entryNode.addChild( createNode( clazz, entry.getValue(), valuePersistName ) );
     
      // add the entry node to the info node representing the map
      node.addChild( entryNode );
    }
   
View Full Code Here

Examples of rocks.xmpp.extensions.disco.model.info.InfoNode

        HeaderManager headerManager = connection1.getExtensionManager(HeaderManager.class);
        headerManager.getSupportedHeaders().add("In-Reply-To");
        headerManager.getSupportedHeaders().add("Keywords");

        ServiceDiscoveryManager serviceDiscoveryManager = connection2.getExtensionManager(ServiceDiscoveryManager.class);
        InfoNode infoNode = null;
        try {
            infoNode = serviceDiscoveryManager.discoverInformation(JULIET);
        } catch (StanzaException e) {
            Assert.fail();
        }
        // By default headers are not support, unless they are enabled.
        Assert.assertFalse(infoNode.getFeatures().contains(new Feature("http://jabber.org/protocol/shim")));

        try {
            serviceDiscoveryManager.discoverInformation(JULIET, "http://jabber.org/protocol/shim");
        } catch (StanzaException e) {
            Assert.assertTrue(e.getStanza().getError().getCondition() instanceof ItemNotFound);
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.