project35.mda.model
Class DataFieldModel

java.lang.Object
  extended by project35.mda.model.DataFieldModel
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
EditFieldModel, ListFieldModel

public abstract class DataFieldModel
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Project35's model data structure for describing a data field.


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  RecordModel containingRecord
          the record that contains this field
protected  boolean isAttribute
          is used to determine whether the field represents an attribute or element in an XML Schema
protected  boolean isRequiredField
          indicates whether the field is optional or required
 
Constructor Summary
DataFieldModel()
           
 
Method Summary
abstract  java.lang.Object clone()
           
 RecordModel getContainingRecord()
           
 java.lang.String getContainingRecordClassName()
           
 FieldViewType getFieldViewType()
           
 java.net.URL getHelpLink()
          Get the value of helpLink.
 java.lang.String getName()
          Get the value of name.
 java.lang.String getNameSpacePrefix()
          Get the value of nameSpacePrefix.
 java.lang.String getToolTip()
           
 boolean isAttribute()
          Get the value of isAttribute.
 boolean isContent()
          Returns whether this EditFieldModel represents the content of an element or not.
 boolean isRequiredField()
           
protected  void populateCloneAttributes(DataFieldModel original, DataFieldModel copy)
          used to clone itself
 void setAttribute(boolean isAttribute)
          determines whether field should represent an XML attribute or XML element
 void setContainingRecord(RecordModel containingRecord)
          sets the record that contains this field
 void setContent(boolean content)
          Sets whether this EditFieldModel represents the content of an element or not.
 void setFieldViewType(FieldViewType fieldViewType)
          sets the hint used to render this field model
 void setHelpLink(java.net.URL helpLink)
          Set the value of helpLink.
 void setName(java.lang.String name)
          Set the value of name.
 void setNameSpacePrefix(java.lang.String nameSpacePrefix)
          Set the value of nameSpacePrefix.
 void setRequiredField(boolean isRequiredField)
          sets whether the field is required or optional
 void setToolTipText(java.lang.String toolTipText)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isRequiredField

protected boolean isRequiredField
indicates whether the field is optional or required


containingRecord

protected RecordModel containingRecord
the record that contains this field


isAttribute

protected boolean isAttribute
is used to determine whether the field represents an attribute or element in an XML Schema

Constructor Detail

DataFieldModel

public DataFieldModel()
Method Detail

getName

public java.lang.String getName()
Get the value of name.

Returns:
value of name.

getHelpLink

public java.net.URL getHelpLink()
Get the value of helpLink.

Returns:
value of helpLink.

isRequiredField

public boolean isRequiredField()
Returns:
true if the field is required; false if the field is optional

getFieldViewType

public FieldViewType getFieldViewType()
Returns:
indicator of how the data field should be rendered. values come from FieldViewType

getContainingRecord

public RecordModel getContainingRecord()
Returns:
the record to which this field belongs

getContainingRecordClassName

public java.lang.String getContainingRecordClassName()

getNameSpacePrefix

public java.lang.String getNameSpacePrefix()
Get the value of nameSpacePrefix.

Returns:
value of nameSpacePrefix.

getToolTip

public java.lang.String getToolTip()

setName

public void setName(java.lang.String name)
Set the value of name.

Parameters:
name - Value to assign to name.

setHelpLink

public void setHelpLink(java.net.URL helpLink)
Set the value of helpLink.

Parameters:
helpLink - Value to assign to helpLink.

setRequiredField

public void setRequiredField(boolean isRequiredField)
sets whether the field is required or optional

Parameters:
isRequiredField - true if the field is required; otherwise the field is optional

populateCloneAttributes

protected void populateCloneAttributes(DataFieldModel original,
                                       DataFieldModel copy)
used to clone itself

Parameters:
original - the original record
copy - the copy of the original record

setFieldViewType

public void setFieldViewType(FieldViewType fieldViewType)
sets the hint used to render this field model

Parameters:
fieldViewType - specifies the hint for rendering the field model

setContainingRecord

public void setContainingRecord(RecordModel containingRecord)
sets the record that contains this field

Parameters:
containingRecord - the record that contains the field

isContent

public boolean isContent()
Returns whether this EditFieldModel represents the content of an element or not. Example for "true":
<element attribute="value1">
value2
</element>
The current EditFieldModel would contain the value "value2".

Returns:
whether this EditFieldModel represents the content of an element or not.

setContent

public void setContent(boolean content)
Sets whether this EditFieldModel represents the content of an element or not. Example for "true":
<element attribute="value1">
value2
</element>
The current EditFieldModel would contain the value "value2".

Parameters:
content - The flag stating whether this EditFieldModel represents the content of an element or not.

isAttribute

public boolean isAttribute()
Get the value of isAttribute.

Returns:
value of isAttribute.

setAttribute

public void setAttribute(boolean isAttribute)
determines whether field should represent an XML attribute or XML element

Parameters:
isAttribute - Value to assign to isAttribute.

setNameSpacePrefix

public void setNameSpacePrefix(java.lang.String nameSpacePrefix)
Set the value of nameSpacePrefix.

Parameters:
nameSpacePrefix - Value to assign to nameSpacePrefix.

setToolTipText

public void setToolTipText(java.lang.String toolTipText)

clone

public abstract java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object