Package ome.dsl
Class Property
- java.lang.Object
-
- ome.dsl.Property
-
public abstract class Property extends java.lang.Objectrepresents the definition of a property within a SemanticType- Since:
- OMERO-3.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBOOLEANstatic java.lang.StringBYTESstatic java.lang.StringCHILDstatic java.lang.StringDOUBLEstatic java.lang.StringDOUBLESstatic java.lang.StringENTRYstatic java.util.Set<java.lang.String>FIELDSstatic java.util.Map<java.lang.String,java.lang.Class<? extends Property>>FIELDS2CLASSESstatic java.lang.StringFLOATstatic java.lang.StringFROMPARENTstatic java.lang.StringINTEGERstatic java.lang.StringINTEGERSstatic java.util.Map<java.lang.String,java.lang.String>JAVATYPESstatic java.lang.StringLONGstatic java.lang.StringMANYONEstatic java.lang.StringMANYZEROstatic java.lang.StringMAPstatic java.lang.StringNONNEGATIVEINTEGERstatic java.lang.StringONEMANYstatic java.lang.StringOPTIONALstatic java.lang.StringPARENTstatic java.lang.StringPERCENTFRACTIONstatic java.lang.StringPOSITIVEFLOATstatic java.lang.StringPOSITIVEINTEGERstatic java.lang.StringREQUIREDstatic java.lang.StringSTRINGstatic java.lang.StringSTRINGSstatic java.lang.StringSTRINGS2static java.lang.StringTEXTstatic java.lang.StringTIMESTAMPstatic java.lang.StringTOCHILDstatic java.lang.StringZEROMANY
-
Constructor Summary
Constructors Modifier Constructor Description protectedProperty(SemanticType st, java.util.Properties attrs, java.util.Properties databaseTypes)creates a Property and sets fields based on attributes USING DEFAULT VALUES.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String_getType()Returns the actual type with no modification.SemanticTypegetActualTarget()SemanticTypegetActualType()java.lang.BooleangetBidirectional()java.lang.StringgetDbType()Read-only variablejava.lang.StringgetDef()java.lang.StringgetDefaultValue()java.lang.BooleangetDeprecated()java.lang.StringgetFieldInitializer()Read-only value.java.lang.StringgetFieldName()Read-only variable 4.2: multiple links to the same object forces us to not use "shortType" (the unqualified type of the link) and instead to use the name of the link relationship.java.lang.StringgetFieldType()Read-only value.java.lang.StringgetForeignKey()java.lang.BooleangetInsert()java.lang.StringgetInverse()java.lang.StringgetInverseCapped()Read-only variablebooleangetIsLink()Read-only property, for subclassingjava.lang.StringgetName()java.lang.StringgetNameCapped()Read-only propertyjava.lang.StringgetNameUpper()Read-only propertyjava.lang.BooleangetNullable()Read-only fieldjava.lang.BooleangetOne2Many()java.lang.BooleangetOrdered()java.lang.BooleangetRequired()java.lang.StringgetShortTarget()Read-only propertyjava.lang.StringgetShortType()Read-only variableSemanticTypegetSt()java.lang.StringgetTag()java.lang.StringgetTarget()java.lang.StringgetTargetName()Read-only property 4.2: multiple links to the same object forces generate a name different from "shortTarget"java.lang.StringgetType()java.lang.StringgetTypeAnnotation()Read-only variablejava.lang.BooleangetUnique()java.lang.BooleangetUpdate()static PropertymakeNew(java.lang.String element, SemanticType st, java.util.Properties attributes, java.util.Properties databaseTypes)creates a new property based on the element-valued key in FIELDS2CLASSES.voidsetActualTarget(SemanticType type)voidsetActualType(SemanticType type)voidsetBidirectional(java.lang.Boolean bdir)voidsetDatabaseTypes(java.util.Properties databaseTypes)voidsetDefaultValue(java.lang.String defaultValue)voidsetDeprecated(java.lang.Boolean deprecated)voidsetForeignKey(java.lang.String foreignKey)voidsetInsert(java.lang.Boolean insert)voidsetInverse(java.lang.String inverse)voidsetName(java.lang.String name)voidsetOne2Many(java.lang.Boolean one2Many)voidsetOrdered(java.lang.Boolean ordered)voidsetRequired(java.lang.Boolean required)voidsetSt(SemanticType st)voidsetTag(java.lang.String tag)voidsetTarget(java.lang.String target)voidsetType(java.lang.String type)voidsetUnique(java.lang.Boolean unique)voidsetUpdate(java.lang.Boolean update)java.lang.StringtoString()voidvalidate()
-
-
-
Field Detail
-
REQUIRED
public static final java.lang.String REQUIRED
- See Also:
- Constant Field Values
-
OPTIONAL
public static final java.lang.String OPTIONAL
- See Also:
- Constant Field Values
-
ONEMANY
public static final java.lang.String ONEMANY
- See Also:
- Constant Field Values
-
ZEROMANY
public static final java.lang.String ZEROMANY
- See Also:
- Constant Field Values
-
MANYONE
public static final java.lang.String MANYONE
- See Also:
- Constant Field Values
-
MANYZERO
public static final java.lang.String MANYZERO
- See Also:
- Constant Field Values
-
ENTRY
public static final java.lang.String ENTRY
- See Also:
- Constant Field Values
-
CHILD
public static final java.lang.String CHILD
- See Also:
- Constant Field Values
-
PARENT
public static final java.lang.String PARENT
- See Also:
- Constant Field Values
-
TOCHILD
public static final java.lang.String TOCHILD
- See Also:
- Constant Field Values
-
FROMPARENT
public static final java.lang.String FROMPARENT
- See Also:
- Constant Field Values
-
MAP
public static final java.lang.String MAP
- See Also:
- Constant Field Values
-
FIELDS
public static final java.util.Set<java.lang.String> FIELDS
-
FIELDS2CLASSES
public static final java.util.Map<java.lang.String,java.lang.Class<? extends Property>> FIELDS2CLASSES
-
STRING
public static final java.lang.String STRING
- See Also:
- Constant Field Values
-
BOOLEAN
public static final java.lang.String BOOLEAN
- See Also:
- Constant Field Values
-
INTEGER
public static final java.lang.String INTEGER
- See Also:
- Constant Field Values
-
FLOAT
public static final java.lang.String FLOAT
- See Also:
- Constant Field Values
-
DOUBLE
public static final java.lang.String DOUBLE
- See Also:
- Constant Field Values
-
LONG
public static final java.lang.String LONG
- See Also:
- Constant Field Values
-
TIMESTAMP
public static final java.lang.String TIMESTAMP
- See Also:
- Constant Field Values
-
TEXT
public static final java.lang.String TEXT
- See Also:
- Constant Field Values
-
BYTES
public static final java.lang.String BYTES
- See Also:
- Constant Field Values
-
DOUBLES
public static final java.lang.String DOUBLES
- See Also:
- Constant Field Values
-
STRINGS
public static final java.lang.String STRINGS
- See Also:
- Constant Field Values
-
STRINGS2
public static final java.lang.String STRINGS2
- See Also:
- Constant Field Values
-
INTEGERS
public static final java.lang.String INTEGERS
- See Also:
- Constant Field Values
-
POSITIVEFLOAT
public static final java.lang.String POSITIVEFLOAT
- See Also:
- Constant Field Values
-
POSITIVEINTEGER
public static final java.lang.String POSITIVEINTEGER
- See Also:
- Constant Field Values
-
NONNEGATIVEINTEGER
public static final java.lang.String NONNEGATIVEINTEGER
- See Also:
- Constant Field Values
-
PERCENTFRACTION
public static final java.lang.String PERCENTFRACTION
- See Also:
- Constant Field Values
-
JAVATYPES
public static final java.util.Map<java.lang.String,java.lang.String> JAVATYPES
-
-
Constructor Detail
-
Property
protected Property(SemanticType st, java.util.Properties attrs, java.util.Properties databaseTypes)
creates a Property and sets fields based on attributes USING DEFAULT VALUES. Subclasses may override these values
-
-
Method Detail
-
validate
public void validate()
-
makeNew
public static Property makeNew(java.lang.String element, SemanticType st, java.util.Properties attributes, java.util.Properties databaseTypes) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
creates a new property based on the element-valued key in FIELDS2CLASSES. Used mainly by the xml reader- Throws:
java.lang.IllegalArgumentExceptionjava.lang.IllegalStateException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setDatabaseTypes
public void setDatabaseTypes(java.util.Properties databaseTypes)
-
setSt
public void setSt(SemanticType st)
-
getSt
public SemanticType getSt()
-
setName
public void setName(java.lang.String name)
-
getName
public java.lang.String getName()
-
getNameCapped
public java.lang.String getNameCapped()
Read-only property
-
getNameUpper
public java.lang.String getNameUpper()
Read-only property
-
setType
public void setType(java.lang.String type)
-
getType
public java.lang.String getType()
-
_getType
public java.lang.String _getType()
Returns the actual type with no modification.getType()is probably poorly named, but changing it would require changing all the templates extensively.
-
setActualType
public void setActualType(SemanticType type)
-
getActualType
public SemanticType getActualType()
-
setActualTarget
public void setActualTarget(SemanticType type)
-
getActualTarget
public SemanticType getActualTarget()
-
getDbType
public java.lang.String getDbType()
Read-only variable
-
getTypeAnnotation
public java.lang.String getTypeAnnotation()
Read-only variable
-
getShortType
public java.lang.String getShortType()
Read-only variable
-
getFieldName
public java.lang.String getFieldName()
Read-only variable 4.2: multiple links to the same object forces us to not use "shortType" (the unqualified type of the link) and instead to use the name of the link relationship. TODO: In later versions, we could always use this value in order to have everything more consistent and simple.
-
getFieldType
public java.lang.String getFieldType()
Read-only value. Overwritten in subclasses
-
getFieldInitializer
public java.lang.String getFieldInitializer()
Read-only value. Overwritten in subclasses
-
setTag
public void setTag(java.lang.String tag)
-
getTag
public java.lang.String getTag()
-
setTarget
public void setTarget(java.lang.String target)
-
getTarget
public java.lang.String getTarget()
-
getShortTarget
public java.lang.String getShortTarget()
Read-only property
-
getTargetName
public java.lang.String getTargetName()
Read-only property 4.2: multiple links to the same object forces generate a name different from "shortTarget"- See Also:
getShortType()
-
setDefaultValue
public void setDefaultValue(java.lang.String defaultValue)
-
getDefaultValue
public java.lang.String getDefaultValue()
-
setRequired
public void setRequired(java.lang.Boolean required)
-
getRequired
public java.lang.Boolean getRequired()
-
getNullable
public java.lang.Boolean getNullable()
Read-only field
-
setUnique
public void setUnique(java.lang.Boolean unique)
-
getUnique
public java.lang.Boolean getUnique()
-
setOrdered
public void setOrdered(java.lang.Boolean ordered)
-
getOrdered
public java.lang.Boolean getOrdered()
-
setInverse
public void setInverse(java.lang.String inverse)
-
getInverse
public java.lang.String getInverse()
-
getInverseCapped
public java.lang.String getInverseCapped()
Read-only variable
-
setInsert
public void setInsert(java.lang.Boolean insert)
-
getInsert
public java.lang.Boolean getInsert()
-
setUpdate
public void setUpdate(java.lang.Boolean update)
-
getUpdate
public java.lang.Boolean getUpdate()
-
setForeignKey
public void setForeignKey(java.lang.String foreignKey)
-
getForeignKey
public java.lang.String getForeignKey()
-
setOne2Many
public void setOne2Many(java.lang.Boolean one2Many)
-
getOne2Many
public java.lang.Boolean getOne2Many()
-
setBidirectional
public void setBidirectional(java.lang.Boolean bdir)
-
getBidirectional
public java.lang.Boolean getBidirectional()
-
setDeprecated
public void setDeprecated(java.lang.Boolean deprecated)
-
getDeprecated
public java.lang.Boolean getDeprecated()
-
getDef
public java.lang.String getDef()
- Returns:
- the database definition for the property's type, or an empty string
- See Also:
- ticket 803
-
getIsLink
public boolean getIsLink()
Read-only property, for subclassing
-
-