phenote.datamodel
Class CharField

java.lang.Object
  extended by phenote.datamodel.CharField

public class CharField
extends java.lang.Object


Field Summary
(package private) static java.lang.String LIST_DELIM
           
 
Constructor Summary
CharField(CharFieldEnum c)
          used for relationship
CharField(FieldConfig fc)
          heck why not just pass in the FieldConfig with its xml config bean
CharField(java.lang.String name, java.lang.String tag, phenote.config.xml.FieldDocument.Field.Type.Enum type)
          a generic field with no char field enum - get hip type is from field xml bean: TERM, FREE_TEXT...
 
Method Summary
 void addOntology(Ontology o)
           
 CharFieldEnum getCharFieldEnum()
           
 java.lang.String getComponentsGroup()
           
 boolean getCopyEnabled()
           
 phenote.config.xml.FieldDocument.Field getFieldXmlConfigBean()
          returns xml bean from configuration used to make field, null if doesnt have one
 Ontology getFirstOntology()
           
 java.lang.String getName()
           
 Ontology getOntology()
           
 Ontology getOntologyForName(java.lang.String ontologyName)
          Returns Ontology with name ontologyName (ignores case), ont ex if dont have it
 java.util.List<Ontology> getOntologyList()
           
 CharField getPickListSourceField()
           
 Ontology getPostCompRelOntol()
           
 java.lang.String getTag()
          Tag is what comes from datatag in config, used for referencing field (like from smart atlas servlet), and as dangling prefix for obo mapping, if datatag not set in config, returns name
(package private)  boolean hasCharFieldEnum()
          generic fields dont have enums
 boolean hasMoreThanOneOntology()
           
 boolean hasOneOntology()
           
 boolean hasOntologies()
           
 boolean hasOntology(java.lang.String ontologyName)
           
 boolean isAutoAnnotId()
           
 boolean isAutoGenerated()
          whether field is auto generated when creating new annotations, for instance date_created is automatically set with every new annotation eventually will have user & date_last_update as well...
 boolean isComparison()
           
 boolean isCompound()
          If a CharField is compound, there is another group of fields in the config which the value of this field can be parsed into - this is used by the CharacterListFieldGui.
 boolean isDate()
           
 boolean isField(java.lang.String tag)
          returns true if field has has tag or name of input tag
 boolean isFreeText()
           
 boolean isID()
           
 boolean isInt()
           
 boolean isList()
          return true if holds a list of CharFieldValues, false if just 1 char field value
 boolean isPickList()
           
 boolean isReadOnly()
           
 boolean isTerm()
          This should be redundant with hasOntologies (though with instances this may change?) when ontology is added type is automatically set to TERM
 CharFieldValue makeValue(CharacterI c, java.lang.String valueString)
          if free text returns string charfieldValue, for ontology field valueString is id and searches ontologies for id, throws CharFieldException if invalid date for date field (used to for term not found but now creates dangler instead) this deals with postcomp too) if term is dangler then dangler gets id (valueString) but no name use makeValue(Char,String,String) to get dangler name set as well also deals with lists in format: "xxx","yyy",...
 CharFieldValue makeValue(CharacterI c, java.lang.String valueString, java.lang.String danglerName)
          makes value - value string for term is id - if term is dangler (not in ontology) and danglerName is non null, then danglers name is set to danglerName, danglerName is ONLY used for danglers
 boolean postCompAllowed()
          whether this field allows for post composition - from config - allowed? how bout has?
 void setCopyEnabled(boolean cp)
           
(package private)  void setIsAutoGenerated(boolean isGen)
          set isAutoGenerated state - should this come from enum?
 void setName(java.lang.String n)
           
 void setPostCompAllowed(boolean pca)
           
 void setPostCompRelOntol(Ontology o)
           
 void setType(phenote.config.xml.FieldDocument.Field.Type.Enum t)
          part of constructor? probably
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LIST_DELIM

static final java.lang.String LIST_DELIM
See Also:
Constant Field Values
Constructor Detail

CharField

public CharField(CharFieldEnum c)
used for relationship


CharField

public CharField(java.lang.String name,
                 java.lang.String tag,
                 phenote.config.xml.FieldDocument.Field.Type.Enum type)
a generic field with no char field enum - get hip type is from field xml bean: TERM, FREE_TEXT...


CharField

public CharField(FieldConfig fc)
heck why not just pass in the FieldConfig with its xml config bean

Method Detail

getFieldXmlConfigBean

public phenote.config.xml.FieldDocument.Field getFieldXmlConfigBean()
returns xml bean from configuration used to make field, null if doesnt have one


setCopyEnabled

public void setCopyEnabled(boolean cp)

getCopyEnabled

public boolean getCopyEnabled()

setType

public void setType(phenote.config.xml.FieldDocument.Field.Type.Enum t)
part of constructor? probably


addOntology

public void addOntology(Ontology o)

setName

public void setName(java.lang.String n)

getName

public java.lang.String getName()

getTag

public java.lang.String getTag()
Tag is what comes from datatag in config, used for referencing field (like from smart atlas servlet), and as dangling prefix for obo mapping, if datatag not set in config, returns name


isField

public boolean isField(java.lang.String tag)
returns true if field has has tag or name of input tag


getCharFieldEnum

public CharFieldEnum getCharFieldEnum()

hasCharFieldEnum

boolean hasCharFieldEnum()
generic fields dont have enums


getOntologyList

public java.util.List<Ontology> getOntologyList()

isFreeText

public boolean isFreeText()

isInt

public boolean isInt()

isPickList

public boolean isPickList()

getPickListSourceField

public CharField getPickListSourceField()

isCompound

public boolean isCompound()
If a CharField is compound, there is another group of fields in the config which the value of this field can be parsed into - this is used by the CharacterListFieldGui.


getComponentsGroup

public java.lang.String getComponentsGroup()

isTerm

public boolean isTerm()
This should be redundant with hasOntologies (though with instances this may change?) when ontology is added type is automatically set to TERM


isDate

public boolean isDate()

isID

public boolean isID()

isComparison

public boolean isComparison()

isReadOnly

public boolean isReadOnly()

isAutoAnnotId

public boolean isAutoAnnotId()

isList

public boolean isList()
return true if holds a list of CharFieldValues, false if just 1 char field value


hasOntologies

public boolean hasOntologies()

hasOneOntology

public boolean hasOneOntology()

hasMoreThanOneOntology

public boolean hasMoreThanOneOntology()

getOntology

public Ontology getOntology()

getFirstOntology

public Ontology getFirstOntology()

hasOntology

public boolean hasOntology(java.lang.String ontologyName)

getOntologyForName

public Ontology getOntologyForName(java.lang.String ontologyName)
Returns Ontology with name ontologyName (ignores case), ont ex if dont have it


setPostCompAllowed

public void setPostCompAllowed(boolean pca)

postCompAllowed

public boolean postCompAllowed()
whether this field allows for post composition - from config - allowed? how bout has?


setPostCompRelOntol

public void setPostCompRelOntol(Ontology o)

getPostCompRelOntol

public Ontology getPostCompRelOntol()

makeValue

public CharFieldValue makeValue(CharacterI c,
                                java.lang.String valueString)
                         throws CharFieldException
if free text returns string charfieldValue, for ontology field valueString is id and searches ontologies for id, throws CharFieldException if invalid date for date field (used to for term not found but now creates dangler instead) this deals with postcomp too) if term is dangler then dangler gets id (valueString) but no name use makeValue(Char,String,String) to get dangler name set as well also deals with lists in format: "xxx","yyy",...

Throws:
CharFieldException

makeValue

public CharFieldValue makeValue(CharacterI c,
                                java.lang.String valueString,
                                java.lang.String danglerName)
                         throws CharFieldException
makes value - value string for term is id - if term is dangler (not in ontology) and danglerName is non null, then danglers name is set to danglerName, danglerName is ONLY used for danglers

Throws:
CharFieldException

isAutoGenerated

public boolean isAutoGenerated()
whether field is auto generated when creating new annotations, for instance date_created is automatically set with every new annotation eventually will have user & date_last_update as well...


setIsAutoGenerated

void setIsAutoGenerated(boolean isGen)
set isAutoGenerated state - should this come from enum?


toString

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