Package org.freezedry.persistence.annotations

Examples of org.freezedry.persistence.annotations.Persist


    final List< Field > fields = ReflectionUtils.getAllDeclaredFields( clazz );
    for( final Field field : fields )
    {
      // if the field has a @Persist annotation, and the ignore is true, then
      // simply ignore the field
      final Persist persistAnnotation = field.getAnnotation( Persist.class );
      if( persistAnnotation != null && persistAnnotation.ignore() )
      {
        continue;
      }
     
      // if the field is a class constant (i.e. static final) then don't add the node
View Full Code Here


          final List< Type > types = Arrays.asList( ((ParameterizedType)type).getActualTypeArguments() );
          node.setGenericParameterTypes( types );
        }
       
        // see if the field has a @Persist( instantiateAs = XXXX.class ) annotation
        final Persist annotation = field.getAnnotation( Persist.class );
        if( annotation != null )
        {
          // if no class information is stored in the node, or if the class stored in the
          // node is a super class of the instantiate type, then use the instantiate type
          final Class< ? > instantiateType = annotation.instantiateAs();
          if( !instantiateType.equals( Persist.Null.class ) )
          {
            final Class< ? > nodeClazz = node.getClazz();
            if( nodeClazz == null || ReflectionUtils.isClassOrSuperclass( nodeClazz, instantiateType ) )
            {
View Full Code Here

    final List< Field > fields = ReflectionUtils.getAllDeclaredFields( clazz );
    for( final Field field : fields )
    {
      // if the field has a @Persist annotation, and the ignore is true, then
      // simply ignore the field
      final Persist persistAnnotation = field.getAnnotation( Persist.class );
      if( persistAnnotation != null && persistAnnotation.ignore() )
      {
        continue;
      }
     
      // if the field is a class constant (i.e. static final) then don't add the node
View Full Code Here

          final List< Type > types = Arrays.asList( ((ParameterizedType)type).getActualTypeArguments() );
          node.setGenericParameterTypes( types );
        }
       
        // see if the field has a @Persist( instantiateAs = XXXX.class ) annotation
        final Persist annotation = field.getAnnotation( Persist.class );
        if( annotation != null )
        {
          // if no class information is stored in the node, or if the class stored in the
          // node is a super class of the instantiate type, then use the instantiate type
          final Class< ? > instantiateType = annotation.instantiateAs();
          if( !instantiateType.equals( Persist.Null.class ) )
          {
            final Class< ? > nodeClazz = node.getClazz();
            if( nodeClazz == null || ReflectionUtils.isClassOrSuperclass( nodeClazz, instantiateType ) )
            {
View Full Code Here

   * @return the persistence name for the specified {@link Field}, or null if no persistence
   */
  public static String getPersistenceName( final Field field )
  {
    // see if the field has a @Persist( instantiateAs = XXXX.class ) annotation
    final Persist annotation = field.getAnnotation( Persist.class );
    String persistName = null;
    if( annotation != null )
    {
      persistName = annotation.persistenceName();
    }
    return persistName;
  }
View Full Code Here

   * {@link NodeBuilder} {@link Class} was specified in the annotation.
   */
  public static Class< ? > getNodeBuilderClass( final Field field )
  {
    // see if the field has a @Persist( instantiateAs = XXXX.class ) annotation
    final Persist annotation = field.getAnnotation( Persist.class );
    Class< ? > nodeBuilderClass = null;
    if( annotation != null )
    {
      nodeBuilderClass = annotation.useNodeBuilder();
    }
    return nodeBuilderClass;
  }
View Full Code Here

    final List< Field > fields = ReflectionUtils.getAllDeclaredFields( clazz );
    for( final Field field : fields )
    {
      // if the field has a @Persist annotation, and the ignore is true, then
      // simply ignore the field
      final Persist persistAnnotation = field.getAnnotation( Persist.class );
      if( persistAnnotation != null && persistAnnotation.ignore() )
      {
        continue;
      }
     
      // if the field is a class constant (i.e. static final) then don't add the node
View Full Code Here

          final List< Type > types = Arrays.asList( ((ParameterizedType)type).getActualTypeArguments() );
          node.setGenericParameterTypes( types );
        }
       
        // see if the field has a @Persist( instantiateAs = XXXX.class ) annotation
        final Persist annotation = field.getAnnotation( Persist.class );
        if( annotation != null )
        {
          // if no class information is stored in the node, or if the class stored in the
          // node is a super class of the instantiate type, then use the instantiate type
          final Class< ? > instantiateType = annotation.instantiateAs();
          if( !instantiateType.equals( Persist.Null.class ) )
          {
            final Class< ? > nodeClazz = node.getClazz();
            if( nodeClazz == null || ReflectionUtils.isClassOrSuperclass( nodeClazz, instantiateType ) )
            {
View Full Code Here

    final List< Field > fields = ReflectionUtils.getAllDeclaredFields( clazz );
    for( final Field field : fields )
    {
      // if the field has a @Persist annotation, and the ignore is true, then
      // simply ignore the field
      final Persist persistAnnotation = field.getAnnotation( Persist.class );
      if( persistAnnotation != null && persistAnnotation.ignore() )
      {
        continue;
      }
     
      // if the field is a class constant (i.e. static final) then don't add the node
View Full Code Here

          final List< Type > types = Arrays.asList( ((ParameterizedType)type).getActualTypeArguments() );
          node.setGenericParameterTypes( types );
        }

        // see if the field has a @Persist( instantiateAs = XXXX.class ) annotation
        final Persist annotation = field.getAnnotation( Persist.class );
        if( annotation != null )
        {
          // if no class information is stored in the node, or if the class stored in the
          // node is a super class of the instantiate type, then use the instantiate type
          final Class< ? > instantiateType = annotation.instantiateAs();
          if( !instantiateType.equals( Persist.Null.class ) )
          {
            final Class< ? > nodeClazz = node.getClazz();
            if( nodeClazz == null || ReflectionUtils.isClassOrSuperclass( nodeClazz, instantiateType ) )
            {
View Full Code Here

TOP

Related Classes of org.freezedry.persistence.annotations.Persist

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.