org.formaria.editor.data.pojo
Class PojoMethodArg

java.lang.Object
  extended by org.formaria.aria.data.DataModel
      extended by org.formaria.editor.data.pojo.PojoModelVis
          extended by org.formaria.editor.data.pojo.PojoMethodArg
All Implemented Interfaces:
ModelVis, TreeNodeCaption

public class PojoMethodArg
extends PojoModelVis

DataModel of the arguments of the pojos methods. Works only for primitives.

Copyright (c) Formaria Ltd., 2001-2007, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.


Field Summary
static int ARG_NAME
           
static int ARG_TYPE
           
static int ARG_TYPEG
           
static int ARG_VALUE
           
protected  int argIdx
           
protected  java.lang.Class argumentType
           
protected  java.lang.String genericName
           
protected  PojoModelEx pojoFinder
           
protected  PropertiesRetriever propertiesRetriever
           
 
Fields inherited from class org.formaria.editor.data.pojo.PojoModelVis
adapter, ATTRIB_COMBO, ATTRIB_FREETEXT, ATTRIB_NEDITABLE, dataSource, getterSig, hashcode, ID_ATTRIBUTE, idAttrib, NUM_FIXED_ATTRIBUTE, pojo, pojoClass, pojoCollection, pojoGetter, pojoSetter, setterSig, VALUE_ATTRIBUTE, valueAttrib
 
Fields inherited from class org.formaria.aria.data.DataModel
parentModel, tagName
 
Constructor Summary
PojoMethodArg(PojoMethodArgs pc, int i, java.lang.Class at, java.lang.String gn, PropertiesRetriever ar)
          Full constructor, Creates the new instance of PojoArg class.
 
Method Summary
 int getArgIdx()
          Gets the position of this argument in the list of arguments.
 java.lang.Class getArgumentType()
          Gets the current type of the argument wrapped by this node
 java.lang.String getAttribName(int idx)
          Gets the name of the finder argument's attribute
 int getAttribute(java.lang.String attribName)
          Returns the index of the attribiteNames array whose value is the same as the attribName
 java.lang.String getAttribValue(int idx)
          Gets the value of the finder argument's attribute
 java.util.Vector getBindingAttributes()
          Gets the attributes
 java.lang.String getCaption()
          Gets the caption of this object which will appear in the visualiser tree.
 java.lang.String getGenericName()
          Gets the name of this argument's type, as it occurs in the source code.
 java.lang.String getName()
          Gets the name of this attribute
 int getNumAttributes()
          Returns the number of attributes of this model node
 int getNumChildren()
          Gets the number of children of this model node,
 java.lang.Class getPojoClass()
           
 java.lang.Object getValue()
          Gets the value of the argument
 boolean hasValue()
          Determines wheter the value of this argument has been set.
 boolean isGeneric()
          Indicates whether argument wrapped by this model node was declared in the source code as generic.
 void removeValue()
          Removes the value of this argument.
 void restoreArgument()
          Restores the value of this argument
 void setArgumentType(java.lang.Class newType)
          Sets the new type of the underlying argument.
 void setAttribValue(int idx, java.lang.Object value)
          Sets the value of the attribute.
 void setValue(java.lang.Object val)
          Sets the value of the argument
 
Methods inherited from class org.formaria.editor.data.pojo.PojoModelVis
append, append, get, get, getAdapter, getAttribAvailableValues, getAttribRuntime, getAttribType, getAttribValueAsDouble, getAttribValueAsDouble, getAttribValueAsInt, getAttribValueAsString, getBindingPath, getId, getProperties, getValueAsDouble, getValueAsInt, getValueAsString, hashCode, isAttribEditable, isDirty, set, set, setAttribValue, setCaption, setDirty, setId, setPojo, setPojoClass, setPojoGetter, setPojoSetter
 
Methods inherited from class org.formaria.aria.data.DataModel
addModelListener, clear, fireModelUpdated, get, getParent, getTagName, hasAutoId, hasAutoId, prefixOutputPath, removeChildren, reset, resetAttributes, setNumAttributes, setNumChildren, setParent, setTagName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARG_VALUE

public static final int ARG_VALUE
See Also:
Constant Field Values

ARG_NAME

public static final int ARG_NAME
See Also:
Constant Field Values

ARG_TYPE

public static final int ARG_TYPE
See Also:
Constant Field Values

ARG_TYPEG

public static final int ARG_TYPEG
See Also:
Constant Field Values

argumentType

protected java.lang.Class argumentType

genericName

protected java.lang.String genericName

pojoFinder

protected PojoModelEx pojoFinder

propertiesRetriever

protected PropertiesRetriever propertiesRetriever

argIdx

protected int argIdx
Constructor Detail

PojoMethodArg

public PojoMethodArg(PojoMethodArgs pc,
                     int i,
                     java.lang.Class at,
                     java.lang.String gn,
                     PropertiesRetriever ar)
Full constructor, Creates the new instance of PojoArg class.

Parameters:
idx - argument's position in the list of finder's arguments.
at - the type of the argument wrapped by this model node.
gat - the type of the generic type of the argument
pc - PojoFinderEx object the argument of which is wrapped
ac - object being used to obtain value of the argument wrapped by this PojoFinderArg object
Method Detail

setArgumentType

public void setArgumentType(java.lang.Class newType)
Sets the new type of the underlying argument.

Parameters:
newType - the new type to be set

restoreArgument

public void restoreArgument()
Restores the value of this argument


hasValue

public boolean hasValue()
Determines wheter the value of this argument has been set.

Returns:
true if this argument has a value, false otherwise

removeValue

public void removeValue()
Removes the value of this argument.


getArgumentType

public java.lang.Class getArgumentType()
Gets the current type of the argument wrapped by this node

Returns:
argument type

getGenericName

public java.lang.String getGenericName()
Gets the name of this argument's type, as it occurs in the source code.

Returns:
the name of this argument's type

getName

public java.lang.String getName()
Gets the name of this attribute

Returns:
the name of this attribute

isGeneric

public boolean isGeneric()
Indicates whether argument wrapped by this model node was declared in the source code as generic.

Returns:
true if the argument is generic, false otherwise

setValue

public void setValue(java.lang.Object val)
Sets the value of the argument

Parameters:
val - new value of the wrapped argument

getPojoClass

public java.lang.Class getPojoClass()
Overrides:
getPojoClass in class PojoModelVis

getValue

public java.lang.Object getValue()
Gets the value of the argument

Returns:
value

getNumChildren

public int getNumChildren()
Gets the number of children of this model node,

Overrides:
getNumChildren in class DataModel
Returns:
0, since it wrapps only the primitives

getArgIdx

public int getArgIdx()
Gets the position of this argument in the list of arguments.

Returns:
position of this argument

setAttribValue

public void setAttribValue(int idx,
                           java.lang.Object value)
Sets the value of the attribute. This method is being called from the visualiser's in order to set the new value of the wrapped attribute.

Overrides:
setAttribValue in class PojoModelVis
Parameters:
idx - index of the model's attribute
value - the new values of the underlaying attribute

getAttribute

public int getAttribute(java.lang.String attribName)
Returns the index of the attribiteNames array whose value is the same as the attribName

Overrides:
getAttribute in class PojoModelVis
Parameters:
attribName - The name of the attribute we are trying to locate
Returns:
The index of the attributeNames array containg the name

getCaption

public java.lang.String getCaption()
Gets the caption of this object which will appear in the visualiser tree.

Specified by:
getCaption in interface TreeNodeCaption
Overrides:
getCaption in class PojoModelVis
Returns:
the caption

getNumAttributes

public int getNumAttributes()
Returns the number of attributes of this model node

Overrides:
getNumAttributes in class PojoModelVis
Returns:
3 (type, name, value)

getAttribName

public java.lang.String getAttribName(int idx)
Gets the name of the finder argument's attribute

Overrides:
getAttribName in class PojoModelVis
Parameters:
idx - the index of the attribute
Returns:
the name of the attribute

getAttribValue

public java.lang.String getAttribValue(int idx)
Gets the value of the finder argument's attribute

Overrides:
getAttribValue in class PojoModelVis
Parameters:
idx - the index of the attribute
Returns:
the value of the attribute

getBindingAttributes

public java.util.Vector getBindingAttributes()
Gets the attributes

Specified by:
getBindingAttributes in interface ModelVis
Overrides:
getBindingAttributes in class PojoModelVis
Returns:
Vector containing binding attributes.