org.jvnet.hyperjaxb3.xjc.generator.bean.field
Class SingleField

java.lang.Object
  extended by org.jvnet.hyperjaxb3.xjc.generator.bean.field.AbstractField
      extended by org.jvnet.hyperjaxb3.xjc.generator.bean.field.AbstractFieldWithVar
          extended by org.jvnet.hyperjaxb3.xjc.generator.bean.field.SingleField
All Implemented Interfaces:
com.sun.tools.xjc.outline.FieldOutline
Direct Known Subclasses:
TransientSingleField

public class SingleField
extends AbstractFieldWithVar

Realizes a property through one getter and one setter. This renders:

  T' field;
  T getXXX() { ... }
  void setXXX(T value) { ... }
 

Normally T'=T, but under some tricky circumstances they could be different (like T'=Integer, T=int.) This realization is only applicable to fields with (1,1) or (0,1) multiplicity.

Author:
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)

Nested Class Summary
protected  class SingleField.Accessor
           
 
Field Summary
 
Fields inherited from class org.jvnet.hyperjaxb3.xjc.generator.bean.field.AbstractFieldWithVar
field
 
Fields inherited from class org.jvnet.hyperjaxb3.xjc.generator.bean.field.AbstractField
codeModel, exposedType, implType, outline, prop
 
Constructor Summary
protected SingleField(com.sun.tools.xjc.generator.bean.ClassOutlineImpl context, com.sun.tools.xjc.model.CPropertyInfo prop)
           
protected SingleField(com.sun.tools.xjc.generator.bean.ClassOutlineImpl context, com.sun.tools.xjc.model.CPropertyInfo prop, boolean forcePrimitiveAccess)
           
 
Method Summary
 com.sun.tools.xjc.outline.FieldAccessor create(com.sun.codemodel.JExpression targetObject)
           
 com.sun.codemodel.JType getFieldType()
          Returns the type used to store the value of the field in memory.
 
Methods inherited from class org.jvnet.hyperjaxb3.xjc.generator.bean.field.AbstractFieldWithVar
createField, getGetterMethod, getRawType, ref
 
Methods inherited from class org.jvnet.hyperjaxb3.xjc.generator.bean.field.AbstractField
annotate, castToImplType, generateField, getPropertyInfo, getType, getType, listPossibleTypes, parent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleField

protected SingleField(com.sun.tools.xjc.generator.bean.ClassOutlineImpl context,
                      com.sun.tools.xjc.model.CPropertyInfo prop)

SingleField

protected SingleField(com.sun.tools.xjc.generator.bean.ClassOutlineImpl context,
                      com.sun.tools.xjc.model.CPropertyInfo prop,
                      boolean forcePrimitiveAccess)
Parameters:
forcePrimitiveAccess - forces the setter/getter to expose the primitive type. it's a pointless customization, but it's nevertheless in the spec.
Method Detail

getFieldType

public final com.sun.codemodel.JType getFieldType()
Description copied from class: AbstractFieldWithVar
Returns the type used to store the value of the field in memory.

Specified by:
getFieldType in class AbstractFieldWithVar

create

public com.sun.tools.xjc.outline.FieldAccessor create(com.sun.codemodel.JExpression targetObject)


Copyright © 2005-2014. All Rights Reserved.