Examples of Persist


Examples of org.apache.tapestry5.annotations.Persist

        }
    }

    private void makeFieldPersistent(TransformField field, MutableComponentModel model)
    {
        Persist annotation = field.getAnnotation(Persist.class);

        field.claim(annotation);

        final String logicalFieldName = model.setFieldPersistenceStrategy(field.getName(), annotation.value());

        final Object defaultValue = determineDefaultValueFromFieldType(field);

        ComponentValueProvider<FieldValueConduit> provider = new ComponentValueProvider<FieldValueConduit>()
        {
View Full Code Here

Examples of org.apache.tapestry5.annotations.Persist

     */
    private void makeFieldPersistent(String fieldName, ClassTransformation transformation,
                                     MutableComponentModel model)
    {
        String fieldType = transformation.getFieldType(fieldName);
        Persist annotation = transformation.getFieldAnnotation(fieldName, Persist.class);

        transformation.claimField(fieldName, annotation);

        // Record the type of persistence, until needed later.

        String logicalFieldName = model.setFieldPersistenceStrategy(fieldName, annotation.value());

        String defaultValue = TransformUtils.getDefaultValue(fieldType);

        // Force the field back to its default value (null, 0, false) at the end of each request.

View Full Code Here

Examples of org.apache.tapestry5.annotations.Persist

     */
    private void makeFieldPersistent(String fieldName, ClassTransformation transformation,
                                     MutableComponentModel model)
    {
        String fieldType = transformation.getFieldType(fieldName);
        Persist annotation = transformation.getFieldAnnotation(fieldName, Persist.class);

        // Record the type of persistence, until needed later.

        String logicalFieldName = model.setFieldPersistenceStrategy(fieldName, annotation.value());

        String defaultFieldName = transformation.addField(Modifier.PRIVATE, fieldType, fieldName
                + "_default");

        transformation.extendMethod(TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE, format(
View Full Code Here

Examples of org.apache.tapestry5.annotations.Persist

     */
    private void makeFieldPersistent(String fieldName, ClassTransformation transformation,
                                     MutableComponentModel model)
    {
        String fieldType = transformation.getFieldType(fieldName);
        Persist annotation = transformation.getFieldAnnotation(fieldName, Persist.class);

        transformation.claimField(fieldName, annotation);

        // Record the type of persistence, until needed later.

        String logicalFieldName = model.setFieldPersistenceStrategy(fieldName, annotation.value());

        String defaultValue = TransformUtils.getDefaultValue(fieldType);

        // Force the field back to its default value (null, 0, false) at the end of each request.

View Full Code Here

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

Examples of org.freezedry.persistence.annotations.Persist

          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

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

Examples of org.freezedry.persistence.annotations.Persist

          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

Examples of org.freezedry.persistence.annotations.Persist

   * @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

Examples of org.freezedry.persistence.annotations.Persist

   * {@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
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.