|
Ujorm release 1.22 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.extensions.Property<UJO,VALUE>
public class Property<UJO extends Ujo,VALUE>
The main implementation of the interface UjoProperty.
AbstractUjo| Constructor Summary | |
|---|---|
protected |
Property()
Protected constructor |
protected |
Property(java.lang.String name,
java.lang.Class<VALUE> type,
int index)
Constructor with an property order |
protected |
Property(java.lang.String name,
VALUE value,
int index)
Constructor with an property order |
| Method Summary | ||
|---|---|---|
protected static int |
_nextSequence()
Returns a next property index by a synchronized method. |
|
|
add(UjoProperty<? extends VALUE,VALUE_PAR> property)
Create new composite (indirect) instance. |
|
int |
compareTo(UjoProperty p)
Compare to another UjoProperty object by the index and name of the property. |
|
void |
copy(UJO from,
UJO to)
Copy a value from the first UJO object to second one. |
|
UjoProperty<UJO,VALUE> |
descending()
Create a new instance of the indirect property with a descending direction of order. |
|
UjoProperty<UJO,VALUE> |
descending(boolean descending)
Create a new instance of the indirect property with a descending direction of order. |
|
boolean |
equals(UJO ujo,
VALUE value)
Returns true, if the property value equals to a parameter value. |
|
boolean |
equalsName(java.lang.CharSequence name)
Returns true, if the property name equals to the parameter value. |
|
Criterion<UJO> |
forAll()
Create a new Criterion for this property where all results will be true (the result is independed on the value). |
|
Criterion<UJO> |
forNone()
Create a new Criterion for this property where all results will be false (the result is independed on the value). |
|
Criterion<UJO> |
forSql(java.lang.String sqlCondition)
Create a new Criterion for a Native Criterion in SQL statement format. |
|
VALUE |
getDefault()
Returns a Default property value. |
|
int |
getIndex()
Index of Property |
|
java.lang.String |
getName()
Name of Property |
|
java.lang.Class<VALUE> |
getType()
Type of Property |
|
VALUE |
getValue(UJO ujo)
It is a basic method for getting an appropriate type safe value from an MapUjo object. |
|
char |
charAt(int index)
A char from Name |
|
protected void |
checkAttribs()
Check properties |
|
protected Property<UJO,VALUE> |
init(java.lang.String name,
java.lang.Class<VALUE> type,
VALUE defaultValue,
int index,
java.lang.Boolean lock)
Property initialization. |
|
boolean |
isAscending()
A flag for a direction of sorting. |
|
boolean |
isDefault(UJO ujo)
Indicates whether a parameter value of the ujo "equal to" this default value. |
|
boolean |
isDirect()
Returns a true value, if the property contains more properties. |
|
boolean |
isTypeOf(java.lang.Class type)
Returns true if the property type is a type or subtype of the parameter class. |
|
int |
length()
Length of the Name |
|
static
|
newInstance(java.lang.String name,
java.lang.Class<VALUE> type)
Returns a new instance of property where the default value is null. |
|
static
|
newInstance(java.lang.String name,
java.lang.Class<VALUE> type,
int index)
Returns a new instance of property where the default value is null. |
|
static
|
newInstance(java.lang.String name,
java.lang.Class<VALUE> type,
VALUE value,
int index,
boolean lock)
Returns a new instance of property where the default value is null. |
|
static
|
newInstance(java.lang.String name,
VALUE value)
A Property Factory where a property type is related from from default value. |
|
static
|
newInstance(java.lang.String name,
VALUE value,
int index)
A Property Factory where a property type is related from from default value. |
|
static
|
newInstance(UjoProperty p)
A Property Factory where a property type is related from from default value. |
|
static
|
newInstance(UjoProperty p,
int index)
A Property Factory where a property type is related from from default value. |
|
VALUE |
of(UJO ujo)
A shortcut for the method getValue(Ujo). |
|
void |
setValue(UJO ujo,
VALUE value)
It is a basic method for setting an appropriate type safe value to an MapUjo object. |
|
void |
setValueFromDefault(UJO ujo)
Assing a value from the default value. |
|
java.lang.CharSequence |
subSequence(int start,
int end)
Sub sequence from the Name |
|
java.lang.String |
toString()
Returns a name of Property |
|
Criterion<UJO> |
where(Operator operator,
UjoProperty<?,VALUE> value)
Create a new Criterion where this property is related to the value along the parameter Operator. |
|
Criterion<UJO> |
where(Operator operator,
VALUE value)
Create a new Criterion where this property is related to the value along the parameter Operator. |
|
Criterion<UJO> |
whereEq(UjoProperty<UJO,VALUE> value)
Create a new Criterion where this property equals the property |
|
Criterion<UJO> |
whereEq(VALUE value)
Create a new Criterion where this property equals the value |
|
Criterion<UJO> |
whereGe(VALUE value)
Create a new Criterion where this property is great or equals the value |
|
Criterion<UJO> |
whereGt(VALUE value)
Create a new Criterion where this property is great then the value |
|
Criterion<UJO> |
whereIn(java.util.Collection<VALUE> list)
Create new Criterion for operator IN to compare value to a list of constants. |
|
Criterion<UJO> |
whereIn(VALUE... list)
Create new Criterion for operator IN to compare value to a list of constants |
|
Criterion<UJO> |
whereLe(VALUE value)
Create a new Criterion where this property is less or equals than the value |
|
Criterion<UJO> |
whereLt(VALUE value)
Create a new Criterion where this property is less then the value |
|
Criterion<UJO> |
whereNeq(VALUE value)
Create a new Criterion where this property not equals the value |
|
Criterion<UJO> |
whereNotIn(java.util.Collection<VALUE> list)
Create new Criterion for operator IN to compare value to a list of constants. |
|
Criterion<UJO> |
whereNotIn(VALUE... list)
Create new Criterion for operator IN to compare value to a list of constants. |
|
Criterion<UJO> |
whereNotNull()
Create a new Criterion where this property is not null. |
|
Criterion<UJO> |
whereNull()
Create a new Criterion where this property is null. |
|
|
writeDefault(VALUE value)
Assign a Default value. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Property(java.lang.String name,
java.lang.Class<VALUE> type,
int index)
name - type - index - On order of the property.
protected Property(java.lang.String name,
VALUE value,
int index)
name - index - On order of the property.protected Property()
| Method Detail |
|---|
protected static int _nextSequence()
protected final Property<UJO,VALUE> init(java.lang.String name,
java.lang.Class<VALUE> type,
VALUE defaultValue,
int index,
java.lang.Boolean lock)
name - Replace the Name of property if the one is NULL.index - Replace index always, the value -1 invoke a next number from the internal sequencer.type - Replace the Type of property if the one is NULL.defaultValue - Replace the Optional default value if the one is NULL.lock - Lock the property.protected void checkAttribs()
public final java.lang.String getName()
getName in interface UjoProperty<UJO extends Ujo,VALUE>public final java.lang.Class<VALUE> getType()
getType in interface UjoProperty<UJO extends Ujo,VALUE>public final int getIndex()
getIndex in interface UjoProperty<UJO extends Ujo,VALUE>ArrayUjo,
UjoManager.readProperties(Class)
public final void setValue(UJO ujo,
VALUE value)
Ujo.writeValue(org.ujorm.UjoProperty, java.lang.Object)
setValue in interface UjoProperty<UJO extends Ujo,VALUE>Ujo.writeValue(org.ujorm.UjoProperty, java.lang.Object)public final VALUE getValue(UJO ujo)
Ujo.readValue(org.ujorm.UjoProperty)
.
getValue in interface UjoProperty<UJO extends Ujo,VALUE>ujo - If a NULL parameter is used then an exception NullPointerException is throwed.
Ujo.readValue(UjoProperty)public final VALUE of(UJO ujo)
of in interface UjoProperty<UJO extends Ujo,VALUE>getValue(Ujo)public VALUE getDefault()
null value in the method Ujo.readValue(...).
If the default value is not modified, returns the null.
- Specified by:
getDefault in interface UjoProperty<UJO extends Ujo,VALUE>
- See Also:
Ujo.readValue(UjoProperty)
public <PROPERTY extends Property> PROPERTY writeDefault(VALUE value)
public void setValueFromDefault(UJO ujo)
public boolean isDefault(UJO ujo)
isDefault in interface UjoProperty<UJO extends Ujo,VALUE>public final boolean isDirect()
isDirect in interface UjoProperty<UJO extends Ujo,VALUE>CompositePropertypublic boolean isAscending()
isAscending in interface UjoProperty<UJO extends Ujo,VALUE>UjoComparatorpublic UjoProperty<UJO,VALUE> descending()
descending in interface UjoProperty<UJO extends Ujo,VALUE>isAscending(),
UjoComparatorpublic UjoProperty<UJO,VALUE> descending(boolean descending)
descending in interface UjoProperty<UJO extends Ujo,VALUE>isAscending(),
UjoComparatorpublic <VALUE_PAR> CompositeProperty<UJO,VALUE_PAR> add(UjoProperty<? extends VALUE,VALUE_PAR> property)
add in interface UjoProperty<UJO extends Ujo,VALUE>
public void copy(UJO from,
UJO to)
copy in interface UjoProperty<UJO extends Ujo,VALUE>public boolean isTypeOf(java.lang.Class type)
isTypeOf in interface UjoProperty<UJO extends Ujo,VALUE>
public boolean equals(UJO ujo,
VALUE value)
equals in interface UjoProperty<UJO extends Ujo,VALUE>ujo - A basic Ujo.value - Null value is supported.
public boolean equalsName(java.lang.CharSequence name)
equalsName in interface UjoProperty<UJO extends Ujo,VALUE>name - The name of a propertypublic int compareTo(UjoProperty p)
compareTo in interface java.lang.Comparable<UjoProperty>compareTo in interface UjoProperty<UJO extends Ujo,VALUE>public char charAt(int index)
charAt in interface java.lang.CharSequencepublic int length()
length in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start,
int end)
subSequence in interface java.lang.CharSequencepublic final java.lang.String toString()
toString in interface java.lang.CharSequencetoString in interface UjoProperty<UJO extends Ujo,VALUE>toString in class java.lang.Object
public static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newInstance(java.lang.String name,
java.lang.Class<VALUE> type,
VALUE value,
int index,
boolean lock)
public static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newInstance(java.lang.String name,
java.lang.Class<VALUE> type,
int index)
public static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newInstance(java.lang.String name,
java.lang.Class<VALUE> type)
public static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newInstance(java.lang.String name,
VALUE value,
int index)
public static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newInstance(java.lang.String name,
VALUE value)
public static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newInstance(UjoProperty p,
int index)
public static <UJO extends Ujo,VALUE> UjoProperty<UJO,VALUE> newInstance(UjoProperty p)
public Criterion<UJO> where(Operator operator,
VALUE value)
Operator.
where in interface CriterionProvider<UJO extends Ujo,VALUE>operator - Operator
public Criterion<UJO> where(Operator operator,
UjoProperty<?,VALUE> value)
Operator.
where in interface CriterionProvider<UJO extends Ujo,VALUE>operator - Operator
public Criterion<UJO> whereEq(VALUE value)
whereEq in interface CriterionProvider<UJO extends Ujo,VALUE>public Criterion<UJO> whereIn(java.util.Collection<VALUE> list)
whereIn in interface CriterionProvider<UJO extends Ujo,VALUE>list - A collection of the values. The collection argument can be the EMPTY, the Criterion result will be FALSE in this case.
public Criterion<UJO> whereNotIn(java.util.Collection<VALUE> list)
whereNotIn in interface CriterionProvider<UJO extends Ujo,VALUE>list - A collection of the values. The collection argument can be the EMPTY, the Criterion result will be TRUE in this case.
public Criterion<UJO> whereIn(VALUE... list)
whereIn in interface CriterionProvider<UJO extends Ujo,VALUE>list - A collection of the values. The collection argument can be the EMPTY, the Criterion result will be FALSE in this case.
public Criterion<UJO> whereNotIn(VALUE... list)
whereNotIn in interface CriterionProvider<UJO extends Ujo,VALUE>list - A collection of the values. The collection argument can be the EMPTY, the Criterion result will be TRUE in this case.
public Criterion<UJO> whereEq(UjoProperty<UJO,VALUE> value)
whereEq in interface CriterionProvider<UJO extends Ujo,VALUE>value - UjoProperty can be type a direct of indirect (for a relation) property
public Criterion<UJO> whereNull()
null.
The method is a shortcut to the next full expression:
Criterin.where(Order.NOTE_PROPERTY, Operator.EQ, (String) null)for the String property type in this case.
whereNull in interface CriterionProvider<UJO extends Ujo,VALUE>#whereNotNull(org.ujorm.UjoProperty),
Operator.EQpublic Criterion<UJO> whereNotNull()
null.
The method is a shortcut to the next full expression:
Criterin.where(Order.NOTE_PROPERTY, Operator.EQ, (String) null)for the String property type in this case.
whereNotNull in interface CriterionProvider<UJO extends Ujo,VALUE>#whereNull(org.ujorm.UjoProperty),
Operator.NOT_EQpublic Criterion<UJO> whereNeq(VALUE value)
whereNeq in interface CriterionProvider<UJO extends Ujo,VALUE>Operator.NOT_EQpublic Criterion<UJO> whereGt(VALUE value)
whereGt in interface CriterionProvider<UJO extends Ujo,VALUE>Operator.GTpublic Criterion<UJO> whereGe(VALUE value)
whereGe in interface CriterionProvider<UJO extends Ujo,VALUE>Operator.GEpublic Criterion<UJO> whereLt(VALUE value)
whereLt in interface CriterionProvider<UJO extends Ujo,VALUE>Operator.LTpublic Criterion<UJO> whereLe(VALUE value)
whereLe in interface CriterionProvider<UJO extends Ujo,VALUE>Operator.LEpublic Criterion<UJO> forSql(java.lang.String sqlCondition)
#evaluate(org.ujorm.Ujo) is not supported and throws UnsupportedOperationException in the run-time
forSql in interface CriterionProvider<UJO extends Ujo,VALUE>sqlCondition - a SQL condition in the String format, the NULL value or empty string is not acceptedOperator.XSQLpublic Criterion<UJO> forAll()
forAll in interface CriterionProvider<UJO extends Ujo,VALUE>public Criterion<UJO> forNone()
forNone in interface CriterionProvider<UJO extends Ujo,VALUE>
|
Ujorm release 1.22 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||