2
0
Fork 0

Moved all data objects to Serializable and some generics bits.

This commit is contained in:
Willem Cazander 2014-05-28 15:15:12 +02:00
parent 1b3e65fa83
commit 3bf185ad48
73 changed files with 228 additions and 181 deletions

View file

@ -55,7 +55,7 @@ public interface VascBackend<DATA_OBJECT extends Serializable> {
* note: Do not use inline class here because it needs to be seriabable and the backend is not seriabbzle. * note: Do not use inline class here because it needs to be seriabable and the backend is not seriabbzle.
* @return * @return
*/ */
public VascEntryFieldValue provideVascEntryFieldValue(); public VascEntryFieldValue<DATA_OBJECT> provideVascEntryFieldValue();
/** /**
* Creates a new RecordCreater obj the the given entry. * Creates a new RecordCreater obj the the given entry.

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.backend; package net.forwardfire.vasc.backend;
import java.io.Serializable;
import java.util.List; import java.util.List;
@ -32,7 +33,7 @@ import java.util.List;
*/ */
public interface VascBackendController { public interface VascBackendController {
public VascBackend getVascBackendById(String id); public VascBackend<Serializable> getVascBackendById(String id);
public List<String> getVascBackendIds(); public List<String> getVascBackendIds();
} }

View file

@ -31,11 +31,11 @@ import java.io.Serializable;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Mar 21, 2007 * @version 1.0 Mar 21, 2007
*/ */
public interface VascEntryFieldValue extends Serializable { public interface VascEntryFieldValue<DATA_OBJECT extends Serializable> extends Serializable {
public Object getValue(String backendName,Object record) throws VascBackendException; public Serializable getValue(String backendName,DATA_OBJECT record) throws VascBackendException;
public String getDisplayValue(String backendName,Object record) throws VascBackendException; public String getDisplayValue(String backendName,DATA_OBJECT record) throws VascBackendException;
public void setValue(String backendName,Object record,Object value) throws VascBackendException; public void setValue(String backendName,DATA_OBJECT record,Serializable value) throws VascBackendException;
} }

View file

@ -23,6 +23,8 @@
package net.forwardfire.vasc.backend.data; package net.forwardfire.vasc.backend.data;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.backend.VascEntryFieldValue; import net.forwardfire.vasc.backend.VascEntryFieldValue;
@ -34,7 +36,7 @@ import org.x4o.xml.element.DefaultElementObjectPropertyValue;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Dec 05, 2009 * @version 1.0 Dec 05, 2009
*/ */
public class BeanVascEntryFieldValue implements VascEntryFieldValue { public class BeanVascEntryFieldValue<DATA_OBJECT extends Serializable> implements VascEntryFieldValue<DATA_OBJECT> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private DefaultElementObjectPropertyValue bean = new DefaultElementObjectPropertyValue(); private DefaultElementObjectPropertyValue bean = new DefaultElementObjectPropertyValue();
@ -42,7 +44,7 @@ public class BeanVascEntryFieldValue implements VascEntryFieldValue {
/** /**
* @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getValue(java.lang.String, java.lang.Object) * @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getValue(java.lang.String, java.lang.Object)
*/ */
public Object getValue(String backendName, Object record) throws VascBackendException { public Serializable getValue(String backendName, DATA_OBJECT record) throws VascBackendException {
if (backendName==null) { if (backendName==null) {
throw new NullPointerException("Can't get value of null backendName."); throw new NullPointerException("Can't get value of null backendName.");
} }
@ -50,7 +52,7 @@ public class BeanVascEntryFieldValue implements VascEntryFieldValue {
throw new NullPointerException("Can't get value of null object."); throw new NullPointerException("Can't get value of null object.");
} }
try { try {
Object o = bean.getProperty(record,backendName); Serializable o = (Serializable)bean.getProperty(record,backendName);
return o; return o;
} catch (Exception e) { } catch (Exception e) {
throw new VascBackendException(e); throw new VascBackendException(e);
@ -60,8 +62,8 @@ public class BeanVascEntryFieldValue implements VascEntryFieldValue {
/** /**
* @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getDisplayValue(java.lang.String, java.lang.Object) * @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getDisplayValue(java.lang.String, java.lang.Object)
*/ */
public String getDisplayValue(String backendName, Object record) throws VascBackendException { public String getDisplayValue(String backendName, DATA_OBJECT record) throws VascBackendException {
Object value = getValue(backendName,record); Serializable value = getValue(backendName,record);
if (value==null) { if (value==null) {
return ""; return "";
} }
@ -89,7 +91,7 @@ public class BeanVascEntryFieldValue implements VascEntryFieldValue {
/** /**
* @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#setValue(java.lang.String, java.lang.Object, java.lang.Object) * @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#setValue(java.lang.String, java.lang.Object, java.lang.Object)
*/ */
public void setValue(String backendName, Object record,Object value) throws VascBackendException { public void setValue(String backendName, DATA_OBJECT record,Serializable value) throws VascBackendException {
if (backendName==null) { if (backendName==null) {
throw new NullPointerException("Can't set value of null backendName."); throw new NullPointerException("Can't set value of null backendName.");
} }

View file

@ -22,43 +22,41 @@
package net.forwardfire.vasc.backend.data; package net.forwardfire.vasc.backend.data;
import java.util.Map; import java.io.Serializable;
import java.util.HashMap;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.backend.VascEntryFieldValue; import net.forwardfire.vasc.backend.VascEntryFieldValue;
/** /**
* MapVascEntryFieldValue provides get/set support on Map record object. * MapVascEntryFieldValue provides get/set support on Map record object.
* *
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Dec 05, 2009 * @version 1.0 Dec 05, 2009
*/ */
public class HashMapVascEntryFieldValue implements VascEntryFieldValue { public class HashMapVascEntryFieldValue implements VascEntryFieldValue<HashMap<String,Serializable>> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getValue(java.lang.String, java.lang.Object) * @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getValue(java.lang.String, java.lang.Object)
*/ */
@SuppressWarnings("unchecked") public Serializable getValue(String backendName,HashMap<String,Serializable> map) throws VascBackendException {
public Object getValue(String backendName, Object record) throws VascBackendException {
if (backendName==null) { if (backendName==null) {
throw new NullPointerException("Can't get value of null backendName field."); throw new NullPointerException("Can't get value of null backendName field.");
} }
if (record==null) { if (map==null) {
throw new NullPointerException("Can't get value of null object."); throw new NullPointerException("Can't get value of null object.");
} }
Map<String,Object> map = (Map<String,Object>)record; Serializable fieldValue = map.get(backendName);
Object fieldValue = map.get(backendName);
return fieldValue; return fieldValue;
} }
/** /**
* @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getDisplayValue(net.forwardfire.vasc.core.VascEntryField, java.lang.Object) * @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#getDisplayValue(net.forwardfire.vasc.core.VascEntryField, java.lang.Object)
*/ */
public String getDisplayValue(String field, Object record) throws VascBackendException { public String getDisplayValue(String field, HashMap<String,Serializable> record) throws VascBackendException {
Object fieldValue = getValue(field,record); Serializable fieldValue = getValue(field,record);
if (fieldValue==null) { if (fieldValue==null) {
fieldValue = ""; fieldValue = "";
} }
@ -68,10 +66,7 @@ public class HashMapVascEntryFieldValue implements VascEntryFieldValue {
/** /**
* @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#setValue(java.lang.String, java.lang.Object, java.lang.Object) * @see net.forwardfire.vasc.core.entry.VascEntryFieldValue#setValue(java.lang.String, java.lang.Object, java.lang.Object)
*/ */
@SuppressWarnings("unchecked") public void setValue(String backendName, HashMap<String,Serializable> map,Serializable value) throws VascBackendException {
public void setValue(String backendName, Object record,Object value) throws VascBackendException {
Map<String,Object> map = (Map<String,Object>)record;
map.put(backendName, value); map.put(backendName, value);
} }
} }

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.backend.data; package net.forwardfire.vasc.backend.data;
import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
@ -33,11 +34,11 @@ import net.forwardfire.vasc.backend.VascEntryRecordCreator;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Dec 05, 2009 * @version 1.0 Dec 05, 2009
*/ */
public class HashMapVascEntryRecordCreator implements VascEntryRecordCreator<HashMap<String,Object>> { public class HashMapVascEntryRecordCreator implements VascEntryRecordCreator<HashMap<String,Serializable>> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public HashMap<String,Object> newRecord() throws VascBackendException { public HashMap<String,Serializable> newRecord() throws VascBackendException {
return new HashMap<String,Object>(10); return new HashMap<String,Serializable>(10);
} }
} }

View file

@ -45,7 +45,6 @@ import org.eobjects.metamodel.schema.Table;
import net.forwardfire.vasc.backend.AbstractVascBackend; import net.forwardfire.vasc.backend.AbstractVascBackend;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.backend.VascBackendState; import net.forwardfire.vasc.backend.VascBackendState;
import net.forwardfire.vasc.backend.VascEntryFieldValue;
import net.forwardfire.vasc.backend.VascEntryRecordCreator; import net.forwardfire.vasc.backend.VascEntryRecordCreator;
import net.forwardfire.vasc.backend.metamodel.crud.CrudDataContext; import net.forwardfire.vasc.backend.metamodel.crud.CrudDataContext;
import net.forwardfire.vasc.backend.metamodel.crud.UpdateableRow; import net.forwardfire.vasc.backend.metamodel.crud.UpdateableRow;
@ -283,7 +282,7 @@ public class MetaModelVascBackend extends AbstractVascBackend<Row> {
crudDataContext.delete((UpdateableRow) object); crudDataContext.delete((UpdateableRow) object);
} }
public VascEntryFieldValue provideVascEntryFieldValue() { public RowVascEntryFieldValue provideVascEntryFieldValue() {
return new RowVascEntryFieldValue(); return new RowVascEntryFieldValue();
} }

View file

@ -1,5 +1,7 @@
package net.forwardfire.vasc.backend.metamodel; package net.forwardfire.vasc.backend.metamodel;
import java.io.Serializable;
import org.eobjects.metamodel.data.Row; import org.eobjects.metamodel.data.Row;
import org.eobjects.metamodel.query.SelectItem; import org.eobjects.metamodel.query.SelectItem;
@ -7,14 +9,14 @@ import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.backend.VascEntryFieldValue; import net.forwardfire.vasc.backend.VascEntryFieldValue;
import net.forwardfire.vasc.backend.metamodel.crud.UpdateableRow; import net.forwardfire.vasc.backend.metamodel.crud.UpdateableRow;
public class RowVascEntryFieldValue implements VascEntryFieldValue { public class RowVascEntryFieldValue implements VascEntryFieldValue<Row> {
private static final long serialVersionUID = -806674640688182132L; private static final long serialVersionUID = -806674640688182132L;
/** /**
* @see net.forwardfire.vasc.backend.VascEntryFieldValue#getValue(java.lang.String, java.lang.Object) * @see net.forwardfire.vasc.backend.VascEntryFieldValue#getValue(java.lang.String, java.lang.Object)
*/ */
public Object getValue(String backendName, Object record) throws VascBackendException { public Serializable getValue(String backendName, Row record) throws VascBackendException {
if (backendName==null) { if (backendName==null) {
throw new NullPointerException("Can't get value of null backendName."); throw new NullPointerException("Can't get value of null backendName.");
} }
@ -23,10 +25,9 @@ public class RowVascEntryFieldValue implements VascEntryFieldValue {
} }
if (record instanceof UpdateableRow) { if (record instanceof UpdateableRow) {
UpdateableRow row = (UpdateableRow)record; UpdateableRow row = (UpdateableRow)record;
return row.getValue(backendName); return (Serializable) row.getValue(backendName);
} }
Row row = (Row)record; Serializable fieldValue = (Serializable) record.getValue(indexOf(backendName,record));
Object fieldValue = row.getValue(indexOf(backendName,row));
return fieldValue; return fieldValue;
} }
@ -47,7 +48,7 @@ public class RowVascEntryFieldValue implements VascEntryFieldValue {
/** /**
* @see net.forwardfire.vasc.backend.VascEntryFieldValue#getDisplayValue(java.lang.String, java.lang.Object) * @see net.forwardfire.vasc.backend.VascEntryFieldValue#getDisplayValue(java.lang.String, java.lang.Object)
*/ */
public String getDisplayValue(String backendName, Object record) throws VascBackendException { public String getDisplayValue(String backendName, Row record) throws VascBackendException {
Object fieldValue = getValue(backendName,record); Object fieldValue = getValue(backendName,record);
if (fieldValue==null) { if (fieldValue==null) {
fieldValue = ""; fieldValue = "";
@ -58,7 +59,7 @@ public class RowVascEntryFieldValue implements VascEntryFieldValue {
/** /**
* @see net.forwardfire.vasc.backend.VascEntryFieldValue#setValue(java.lang.String, java.lang.Object, java.lang.Object) * @see net.forwardfire.vasc.backend.VascEntryFieldValue#setValue(java.lang.String, java.lang.Object, java.lang.Object)
*/ */
public void setValue(String backendName, Object record,Object value) throws VascBackendException { public void setValue(String backendName, Row record,Serializable value) throws VascBackendException {
if (record instanceof UpdateableRow) { if (record instanceof UpdateableRow) {
UpdateableRow row = (UpdateableRow)record; UpdateableRow row = (UpdateableRow)record;
row.setValue(backendName, value); row.setValue(backendName, value);

View file

@ -29,7 +29,6 @@ import java.util.logging.Logger;
import net.forwardfire.vasc.backend.AbstractVascBackend; import net.forwardfire.vasc.backend.AbstractVascBackend;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.backend.VascBackendState; import net.forwardfire.vasc.backend.VascBackendState;
import net.forwardfire.vasc.backend.VascEntryFieldValue;
import net.forwardfire.vasc.backend.VascEntryRecordCreator; import net.forwardfire.vasc.backend.VascEntryRecordCreator;
import com.mongodb.DB; import com.mongodb.DB;
@ -142,7 +141,7 @@ public class MongodbVascBackend extends AbstractVascBackend<BasicDBObject> {
coll.remove(query); // remove by _id coll.remove(query); // remove by _id
} }
public VascEntryFieldValue provideVascEntryFieldValue() { public MongodbVascEntryFieldValue provideVascEntryFieldValue() {
return new MongodbVascEntryFieldValue(); return new MongodbVascEntryFieldValue();
} }

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.backend.mongodb; package net.forwardfire.vasc.backend.mongodb;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.backend.VascEntryFieldValue; import net.forwardfire.vasc.backend.VascEntryFieldValue;
@ -33,22 +35,20 @@ import com.mongodb.BasicDBObject;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Dec 30, 2011 * @version 1.0 Dec 30, 2011
*/ */
public class MongodbVascEntryFieldValue implements VascEntryFieldValue { public class MongodbVascEntryFieldValue implements VascEntryFieldValue<BasicDBObject> {
private static final long serialVersionUID = -7371273796529818557L; private static final long serialVersionUID = -7371273796529818557L;
public Object getValue(String backendName, Object record) throws VascBackendException { public Serializable getValue(String backendName, BasicDBObject row) throws VascBackendException {
BasicDBObject row = (BasicDBObject)record; Serializable data = (Serializable) row.get(backendName);
Object data = row.get(backendName);
return data; return data;
} }
public String getDisplayValue(String field, Object record) throws VascBackendException { public String getDisplayValue(String field, BasicDBObject row) throws VascBackendException {
return ""+getValue(field,record); return ""+getValue(field,row);
} }
public void setValue(String backendName, Object record, Object value) throws VascBackendException { public void setValue(String backendName, BasicDBObject row, Serializable value) throws VascBackendException {
BasicDBObject row = (BasicDBObject)record;
row.put(backendName, value); row.put(backendName, value);
} }
} }

View file

@ -85,10 +85,10 @@ public class VascChoicesSelectItemModel implements VascSelectItemModel,Serializa
name = entry.getVascFrontendController().getVascEntryResourceResolver().getTextValue(key); name = entry.getVascFrontendController().getVascEntryResourceResolver().getTextValue(key);
} }
item.setLabel(name); item.setLabel(name);
Object value = vascChoices.choisesValues()[index]; Serializable value = vascChoices.choisesValues()[index];
if (vascChoices.choisesType().equals(String.class)==false) { if (vascChoices.choisesType().equals(String.class)==false) {
try { try {
value = vascChoices.choisesType().getConstructor(String.class).newInstance(key); value = (Serializable) vascChoices.choisesType().getConstructor(String.class).newInstance(key);
} catch (Exception e) { } catch (Exception e) {
} }
} }

View file

@ -148,7 +148,7 @@ abstract public class AbstractVascBackendProxy implements VascBackendProxy {
/** /**
* @see net.forwardfire.vasc.backend.VascBackend#provideVascEntryFieldValue() * @see net.forwardfire.vasc.backend.VascBackend#provideVascEntryFieldValue()
*/ */
public VascEntryFieldValue provideVascEntryFieldValue() { public VascEntryFieldValue<Serializable> provideVascEntryFieldValue() {
return backend.provideVascEntryFieldValue(); return backend.provideVascEntryFieldValue();
} }

View file

@ -83,8 +83,8 @@ public class VascBackendProxySearch extends AbstractVascBackendProxy {
List<Serializable> search = new ArrayList<Serializable>(result.size()/4); List<Serializable> search = new ArrayList<Serializable>(result.size()/4);
for (Serializable record:result) { for (Serializable record:result) {
for (VascEntryField field:entry.getVascEntryFields()) { for (VascEntryField field:entry.getVascEntryFields()) {
VascEntryFieldValue fieldValue = backend.provideVascEntryFieldValue(); VascEntryFieldValue<Serializable> fieldValue = backend.provideVascEntryFieldValue();
Object value = fieldValue.getValue(field.getBackendName(), record); Serializable value = fieldValue.getValue(field.getBackendName(), record);
if (value==null) { if (value==null) {
continue; // can't search null values. continue; // can't search null values.
} }

View file

@ -80,10 +80,10 @@ public class VascBackendProxySort extends AbstractVascBackendProxy {
return result; return result;
} }
final VascEntryField field = getVascEntryFieldByBackendName(state.getSortField()); final VascEntryField field = getVascEntryFieldByBackendName(state.getSortField());
final VascEntryFieldValue fieldValue = backend.provideVascEntryFieldValue(); final VascEntryFieldValue<Serializable> fieldValue = backend.provideVascEntryFieldValue();
Collections.sort(result, new Comparator<Object>() { Collections.sort(result, new Comparator<Serializable>() {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public int compare(Object o1, Object o2) { public int compare(Serializable o1, Serializable o2) {
try { try {
Comparable c1 = null; Comparable c1 = null;
Comparable c2 = null; Comparable c2 = null;

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.core; package net.forwardfire.vasc.core;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -42,9 +43,9 @@ abstract public class AbstractVascEntryFieldLocal extends AbstractVascBaseIdRole
private String backendName = null; private String backendName = null;
private String displayName = null; private String displayName = null;
private VascEntryFieldType vascEntryFieldType = null; private VascEntryFieldType vascEntryFieldType = null;
private VascEntryFieldValue vascEntryFieldValue = null; private VascEntryFieldValue<Serializable> vascEntryFieldValue = null;
private List<VascValidator> vascValidators = null; private List<VascValidator> vascValidators = null;
private Object defaultValue = null; private Serializable defaultValue = null;
private Integer sizeList = null; private Integer sizeList = null;
private Integer sizeEdit = null; private Integer sizeEdit = null;
private String styleList = null; private String styleList = null;
@ -142,14 +143,14 @@ abstract public class AbstractVascEntryFieldLocal extends AbstractVascBaseIdRole
/** /**
* @return the vascEntryFieldValue * @return the vascEntryFieldValue
*/ */
public VascEntryFieldValue getVascEntryFieldValue() { public VascEntryFieldValue<Serializable> getVascEntryFieldValue() {
return vascEntryFieldValue; return vascEntryFieldValue;
} }
/** /**
* @param vascEntryFieldValue the vascEntryFieldValue to set * @param vascEntryFieldValue the vascEntryFieldValue to set
*/ */
public void setVascEntryFieldValue(VascEntryFieldValue vascEntryFieldValue) { public void setVascEntryFieldValue(VascEntryFieldValue<Serializable> vascEntryFieldValue) {
this.vascEntryFieldValue = vascEntryFieldValue; this.vascEntryFieldValue = vascEntryFieldValue;
} }
@ -178,14 +179,14 @@ abstract public class AbstractVascEntryFieldLocal extends AbstractVascBaseIdRole
/** /**
* @return the defaultValue * @return the defaultValue
*/ */
public Object getDefaultValue() { public Serializable getDefaultValue() {
return defaultValue; return defaultValue;
} }
/** /**
* @param defaultValue the defaultValue to set * @param defaultValue the defaultValue to set
*/ */
public void setDefaultValue(Object defaultValue) { public void setDefaultValue(Serializable defaultValue) {
this.defaultValue = defaultValue; this.defaultValue = defaultValue;
} }

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.core; package net.forwardfire.vasc.core;
import java.io.Serializable;
import java.util.List; import java.util.List;
import net.forwardfire.vasc.backend.VascEntryFieldValue; import net.forwardfire.vasc.backend.VascEntryFieldValue;
@ -55,7 +56,7 @@ public interface VascEntryField extends VascBaseIdRoleCrudOrderMeta {
/** /**
* @return the vascEntryFieldValue * @return the vascEntryFieldValue
*/ */
public VascEntryFieldValue getVascEntryFieldValue(); public VascEntryFieldValue<Serializable> getVascEntryFieldValue();
/** /**
* @return the vascValidators * @return the vascValidators
@ -65,7 +66,7 @@ public interface VascEntryField extends VascBaseIdRoleCrudOrderMeta {
/** /**
* @return the defaultValue * @return the defaultValue
*/ */
public Object getDefaultValue(); public Serializable getDefaultValue();
/** /**
* @return the sizeList * @return the sizeList

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.core; package net.forwardfire.vasc.core;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascEntryFieldValue; import net.forwardfire.vasc.backend.VascEntryFieldValue;
import net.forwardfire.vasc.core.base.VascBaseIdRoleCrudOrderMetaLocal; import net.forwardfire.vasc.core.base.VascBaseIdRoleCrudOrderMetaLocal;
import net.forwardfire.vasc.validators.VascValidator; import net.forwardfire.vasc.validators.VascValidator;
@ -53,7 +55,7 @@ public interface VascEntryFieldLocal extends VascEntryField,VascBaseIdRoleCrudOr
/** /**
* @param vascEntryFieldValue the vascEntryFieldValue to set * @param vascEntryFieldValue the vascEntryFieldValue to set
*/ */
public void setVascEntryFieldValue(VascEntryFieldValue vascEntryFieldValue); public void setVascEntryFieldValue(VascEntryFieldValue<Serializable> vascEntryFieldValue);
/** /**
* @param vascValidator the vascValidator to add * @param vascValidator the vascValidator to add
@ -68,7 +70,7 @@ public interface VascEntryFieldLocal extends VascEntryField,VascBaseIdRoleCrudOr
/** /**
* @param defaultValue the defaultValue to set * @param defaultValue the defaultValue to set
*/ */
public void setDefaultValue(Object defaultValue); public void setDefaultValue(Serializable defaultValue);
/** /**
* @param sizeList the sizeList to set * @param sizeList the sizeList to set

View file

@ -63,5 +63,5 @@ public interface VascEntryFrontendEventListener extends Serializable {
* @param type * @param type
* @param data * @param data
*/ */
public void vascEvent(VascEntry entry,Object data); public void vascEvent(VascEntry entry,Serializable data);
} }

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.core.ui; package net.forwardfire.vasc.core.ui;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.VascException;
@ -35,12 +37,12 @@ import net.forwardfire.vasc.core.VascException;
public class VascColumnValueModelListener implements VascValueModelListener { public class VascColumnValueModelListener implements VascValueModelListener {
private VascEntryField vascEntryField = null; private VascEntryField vascEntryField = null;
private Object bean = null; private Serializable bean = null;
public VascColumnValueModelListener() { public VascColumnValueModelListener() {
} }
public VascColumnValueModelListener(VascEntryField vascEntryField,Object bean) { public VascColumnValueModelListener(VascEntryField vascEntryField,Serializable bean) {
setVascEntryField(vascEntryField); setVascEntryField(vascEntryField);
setBean(bean); setBean(bean);
} }
@ -70,14 +72,14 @@ public class VascColumnValueModelListener implements VascValueModelListener {
/** /**
* @return the bean * @return the bean
*/ */
public Object getBean() { public Serializable getBean() {
return bean; return bean;
} }
/** /**
* @param bean the bean to set * @param bean the bean to set
*/ */
public void setBean(Object bean) { public void setBean(Serializable bean) {
this.bean = bean; this.bean = bean;
} }
} }

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.core.ui; package net.forwardfire.vasc.core.ui;
import java.io.Serializable;
/** /**
* *
* @author Willem Cazander * @author Willem Cazander
@ -30,18 +32,18 @@ package net.forwardfire.vasc.core.ui;
public class VascSelectItem { public class VascSelectItem {
private String label = null; private String label = null;
private Object value = null; private Serializable value = null;
private String keyValue = null; private String keyValue = null;
private boolean disabled = false; private boolean disabled = false;
public VascSelectItem() { public VascSelectItem() {
} }
public VascSelectItem(String label,Object value) { public VascSelectItem(String label,Serializable value) {
setLabel(label); setLabel(label);
setValue(value); setValue(value);
} }
public VascSelectItem(String label,Object value,String keyValue) { public VascSelectItem(String label,Serializable value,String keyValue) {
setLabel(label); setLabel(label);
setValue(value); setValue(value);
setKeyValue(keyValue); setKeyValue(keyValue);
@ -64,14 +66,14 @@ public class VascSelectItem {
/** /**
* @return the value * @return the value
*/ */
public Object getValue() { public Serializable getValue() {
return value; return value;
} }
/** /**
* @param value the value to set * @param value the value to set
*/ */
public void setValue(Object value) { public void setValue(Serializable value) {
this.value = value; this.value = value;
} }

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.core.ui; package net.forwardfire.vasc.core.ui;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -37,7 +38,7 @@ import net.forwardfire.vasc.core.VascException;
*/ */
public class VascValueModel { public class VascValueModel {
private Object value = null; private Serializable value = null;
private List<VascValueModelListener> listeners = null; private List<VascValueModelListener> listeners = null;
private VascValueModel parentModel = null; private VascValueModel parentModel = null;
@ -49,14 +50,14 @@ public class VascValueModel {
this.parentModel=parentModel; this.parentModel=parentModel;
} }
public Object getValue() throws VascException { public Serializable getValue() throws VascException {
if (parentModel!=null) { if (parentModel!=null) {
return parentModel.getValue(); return parentModel.getValue();
} }
return value; return value;
} }
public void setValue(Object value) throws VascException { public void setValue(Serializable value) throws VascException {
if (parentModel!=null) { if (parentModel!=null) {
parentModel.setValue(value); parentModel.setValue(value);
} else { } else {

View file

@ -42,7 +42,7 @@ public interface VascFrontendActions extends VascFrontendEntry {
public void persistObject() throws VascFrontendException; public void persistObject() throws VascFrontendException;
public Object mergeObject() throws VascFrontendException; public Serializable mergeObject() throws VascFrontendException;
public void sortAction(VascEntryField field) throws VascFrontendException; public void sortAction(VascEntryField field) throws VascFrontendException;
@ -50,7 +50,7 @@ public interface VascFrontendActions extends VascFrontendEntry {
public void pageAction(Integer page) throws VascFrontendException; public void pageAction(Integer page) throws VascFrontendException;
public void moveUpAction(Object object) throws VascFrontendException; public void moveUpAction(Serializable object) throws VascFrontendException;
public void moveDownAction(Object object) throws VascFrontendException; public void moveDownAction(Serializable object) throws VascFrontendException;
} }

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.frontend; package net.forwardfire.vasc.frontend;
import java.io.Serializable;
import java.util.List; import java.util.List;
import net.forwardfire.vasc.core.VascController; import net.forwardfire.vasc.core.VascController;
@ -115,7 +116,7 @@ public interface VascFrontendController {
public void initFrontendListeners(VascEntryLocal entry,String frontendType) throws InstantiationException, IllegalAccessException; public void initFrontendListeners(VascEntryLocal entry,String frontendType) throws InstantiationException, IllegalAccessException;
public void addVascEntryFrontendEventListener(VascEntryFrontendEventListener listener); public void addVascEntryFrontendEventListener(VascEntryFrontendEventListener listener);
public List<VascEntryFrontendEventListener> getVascEntryFrontendEventListener(VascEntryFrontendEventListener.VascFrontendEventType type); public List<VascEntryFrontendEventListener> getVascEntryFrontendEventListener(VascEntryFrontendEventListener.VascFrontendEventType type);
public void fireVascFrontendEvent(VascEntry entry,VascFrontendEventType type,Object data); public void fireVascFrontendEvent(VascEntry entry,VascFrontendEventType type,Serializable data);
/** /**

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl; package net.forwardfire.vasc.impl;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -169,8 +170,8 @@ public class DefaultVascEntryConfigController implements VascEntryConfigControll
/** /**
* @see net.forwardfire.vasc.core.VascEntryConfigController#configVascBackendProxied(net.forwardfire.vasc.core.VascController, net.forwardfire.vasc.core.VascEntry) * @see net.forwardfire.vasc.core.VascEntryConfigController#configVascBackendProxied(net.forwardfire.vasc.core.VascController, net.forwardfire.vasc.core.VascEntry)
*/ */
public VascBackend configVascBackendProxied(VascController vascController,VascEntry vascEntry) throws VascException { public VascBackend<Serializable> configVascBackendProxied(VascController vascController,VascEntry vascEntry) throws VascException {
VascBackend realBackend = vascController.getVascBackendController().getVascBackendById(vascEntry.getBackendId()); VascBackend<Serializable> realBackend = vascController.getVascBackendController().getVascBackendById(vascEntry.getBackendId());
if (realBackend==null) { if (realBackend==null) {
throw new VascException("Could not find backend: "+vascEntry.getBackendId()); throw new VascException("Could not find backend: "+vascEntry.getBackendId());
} }
@ -180,8 +181,8 @@ public class DefaultVascEntryConfigController implements VascEntryConfigControll
/** /**
* @see net.forwardfire.vasc.core.VascEntryConfigController#configVascBackendProxied(net.forwardfire.vasc.core.VascController, net.forwardfire.vasc.core.VascEntry, net.forwardfire.vasc.backend.VascBackend) * @see net.forwardfire.vasc.core.VascEntryConfigController#configVascBackendProxied(net.forwardfire.vasc.core.VascController, net.forwardfire.vasc.core.VascEntry, net.forwardfire.vasc.backend.VascBackend)
*/ */
public VascBackend configVascBackendProxied(VascController vascController,VascEntry vascEntry, VascBackend realBackend) throws VascException { public VascBackend<Serializable> configVascBackendProxied(VascController vascController,VascEntry vascEntry, VascBackend<Serializable> realBackend) throws VascException {
VascBackend backend = realBackend; VascBackend<Serializable> backend = realBackend;
for (VascBackendProxy proxy:backendProxies) { for (VascBackendProxy proxy:backendProxies) {
VascBackendProxy proxyClone; VascBackendProxy proxyClone;
try { try {
@ -247,14 +248,14 @@ public class DefaultVascEntryConfigController implements VascEntryConfigControll
} }
// Add backend to entry // Add backend to entry
VascBackend backend = vascController.getVascEntryConfigController().configVascBackendProxied(vascController, entry); VascBackend<Serializable> backend = vascController.getVascEntryConfigController().configVascBackendProxied(vascController, entry);
controller.getVascEntryState().setVascBackend(backend); controller.getVascEntryState().setVascBackend(backend);
controller.getVascEntryState().setVascEntry(entry); controller.getVascEntryState().setVascEntry(entry);
// Fetch all data field value impl for this backend. // Fetch all data field value impl for this backend.
for (VascEntryField field:entry.getVascEntryFields()) { for (VascEntryField field:entry.getVascEntryFields()) {
if (field.getVascEntryFieldValue()==null) { if (field.getVascEntryFieldValue()==null) {
VascEntryFieldValue v = backend.provideVascEntryFieldValue(); VascEntryFieldValue<Serializable> v = backend.provideVascEntryFieldValue();
((VascEntryFieldLocal)field).setVascEntryFieldValue(v); ((VascEntryFieldLocal)field).setVascEntryFieldValue(v);
} }
} }

View file

@ -122,7 +122,7 @@ public class HibernateValidatorService implements VascEntryFieldValidatorService
//do not resolve the property eagerly to allow validator.apply to work wo interpolator //do not resolve the property eagerly to allow validator.apply to work wo interpolator
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes")
public String interpolate(String message, Validator validator, MessageInterpolator defaultInterpolator) { public String interpolate(String message, Validator validator, MessageInterpolator defaultInterpolator) {
if ( annotationMessage!=null && annotationMessage.equals( message ) ) { if ( annotationMessage!=null && annotationMessage.equals( message ) ) {
//short cut //short cut

View file

@ -23,7 +23,6 @@
package net.forwardfire.vasc.impl.entry.config; package net.forwardfire.vasc.impl.entry.config;
import net.forwardfire.vasc.core.VascController; import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryConfigFinalizer; import net.forwardfire.vasc.core.VascEntryConfigFinalizer;
import net.forwardfire.vasc.core.VascEntryLocal; import net.forwardfire.vasc.core.VascEntryLocal;
import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.VascException;

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl.entry.config; package net.forwardfire.vasc.impl.entry.config;
import java.io.Serializable;
import java.util.Locale; import java.util.Locale;
import org.x4o.xml.conv.ObjectConverterException; import org.x4o.xml.conv.ObjectConverterException;
@ -57,7 +58,7 @@ public class VascDefaultsFinalizer implements VascEntryConfigFinalizer {
} }
// Check if backendId is valid // Check if backendId is valid
VascBackend back = vascController.getVascBackendController().getVascBackendById( entry.getBackendId() ); VascBackend<Serializable> back = vascController.getVascBackendController().getVascBackendById( entry.getBackendId() );
if (back==null) { if (back==null) {
throw new IllegalArgumentException("The VascEntry backend is not found in backends: '"+entry.getBackendId()+"' in entryId: "+id); throw new IllegalArgumentException("The VascEntry backend is not found in backends: '"+entry.getBackendId()+"' in entryId: "+id);
} }
@ -161,9 +162,9 @@ public class VascDefaultsFinalizer implements VascEntryConfigFinalizer {
if (vef.getDefaultValue()!=null && vef.getDefaultValue() instanceof String) { if (vef.getDefaultValue()!=null && vef.getDefaultValue() instanceof String) {
if (vef.getVascEntryFieldType().getObjectConverter() != null) { if (vef.getVascEntryFieldType().getObjectConverter() != null) {
Object value; Serializable value;
try { try {
value = vef.getVascEntryFieldType().getObjectConverter().convertTo(vef.getDefaultValue(), Locale.getDefault()); value = (Serializable) vef.getVascEntryFieldType().getObjectConverter().convertTo(vef.getDefaultValue(), Locale.getDefault());
} catch (ObjectConverterException e) { } catch (ObjectConverterException e) {
throw new VascException(e); throw new VascException(e);
} }
@ -237,9 +238,9 @@ public class VascDefaultsFinalizer implements VascEntryConfigFinalizer {
if (vef.getDefaultValue()!=null && vef.getDefaultValue() instanceof String) { if (vef.getDefaultValue()!=null && vef.getDefaultValue() instanceof String) {
if (vef.getVascEntryFieldType()!=null && vef.getVascEntryFieldType().getObjectConverter() != null) { if (vef.getVascEntryFieldType()!=null && vef.getVascEntryFieldType().getObjectConverter() != null) {
Object value; Serializable value;
try { try {
value = vef.getVascEntryFieldType().getObjectConverter().convertTo(vef.getDefaultValue(), Locale.getDefault()); value = (Serializable) vef.getVascEntryFieldType().getObjectConverter().convertTo(vef.getDefaultValue(), Locale.getDefault());
} catch (ObjectConverterException e) { } catch (ObjectConverterException e) {
throw new VascException(e); throw new VascException(e);
} }

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.impl.entry.config; package net.forwardfire.vasc.impl.entry.config;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackend; import net.forwardfire.vasc.backend.VascBackend;
import net.forwardfire.vasc.core.VascController; import net.forwardfire.vasc.core.VascController;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
@ -65,7 +67,7 @@ public class VascIdCheckFinalizer implements VascEntryConfigFinalizer {
} }
// Check if backendId is valid // Check if backendId is valid
VascBackend back = vascController.getVascBackendController().getVascBackendById( entry.getBackendId() ); VascBackend<Serializable> back = vascController.getVascBackendController().getVascBackendById( entry.getBackendId() );
if (back==null) { if (back==null) {
throw new IllegalArgumentException("The VascEntry backend is not found in backends: '"+entry.getBackendId()+"' in entryId: "+id); throw new IllegalArgumentException("The VascEntry backend is not found in backends: '"+entry.getBackendId()+"' in entryId: "+id);
} }

View file

@ -31,13 +31,11 @@ import net.forwardfire.vasc.backend.VascBackendState;
import net.forwardfire.vasc.backend.proxy.VascProxyFilter; import net.forwardfire.vasc.backend.proxy.VascProxyFilter;
import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.VascEntryLocal;
import net.forwardfire.vasc.core.entry.VascEntryFrontendEventListener; import net.forwardfire.vasc.core.entry.VascEntryFrontendEventListener;
import net.forwardfire.vasc.core.VascException; import net.forwardfire.vasc.core.VascException;
import net.forwardfire.vasc.frontend.VascFrontendActions; import net.forwardfire.vasc.frontend.VascFrontendActions;
import net.forwardfire.vasc.frontend.VascFrontendException; import net.forwardfire.vasc.frontend.VascFrontendException;
/** /**
* Default impl of default frontend actions * Default impl of default frontend actions
* *
@ -72,11 +70,11 @@ public class DefaultVascFrontendActions implements VascFrontendActions {
continue; // no default value to set. continue; // no default value to set.
} }
try { try {
Object value = field.getVascEntryFieldValue().getValue(field.getBackendName(), object); Serializable value = field.getVascEntryFieldValue().getValue(field.getBackendName(), object);
if (value!=null) { if (value!=null) {
continue; // value is already set by backend creator. continue; // value is already set by backend creator.
} }
Object defaultValue = field.getDefaultValue(); Serializable defaultValue = field.getDefaultValue();
if (defaultValue instanceof String) { if (defaultValue instanceof String) {
String def = (String)defaultValue; String def = (String)defaultValue;
if (def.equals("now()")) { // TODO: add default string parsers if (def.equals("now()")) { // TODO: add default string parsers
@ -93,7 +91,7 @@ public class DefaultVascFrontendActions implements VascFrontendActions {
return object; return object;
} }
protected int removeObjectFromDataList(Object object) throws VascBackendException { protected int removeObjectFromDataList(Serializable object) throws VascBackendException {
int indexOld = entry.getVascFrontendController().getVascEntryState().getEntryDataList().indexOf(object); int indexOld = entry.getVascFrontendController().getVascEntryState().getEntryDataList().indexOf(object);
if (entry.getVascFrontendController().getVascEntryState().getEntryDataList().remove(object)) { if (entry.getVascFrontendController().getVascEntryState().getEntryDataList().remove(object)) {
return indexOld; // java worked well for use return indexOld; // java worked well for use
@ -107,7 +105,7 @@ public class DefaultVascFrontendActions implements VascFrontendActions {
// is only null when creating objects // is only null when creating objects
if (idObject!=null) { if (idObject!=null) {
int index = 0; int index = 0;
for (Object o:entry.getVascFrontendController().getVascEntryState().getEntryDataList()) { for (Serializable o:entry.getVascFrontendController().getVascEntryState().getEntryDataList()) {
field = entry.getVascEntryFieldById(entry.getPrimaryKeyFieldId()); field = entry.getVascEntryFieldById(entry.getPrimaryKeyFieldId());
Object id = field.getVascEntryFieldValue().getValue(field.getBackendName(), o); Object id = field.getVascEntryFieldValue().getValue(field.getBackendName(), o);
if (idObject.equals(id)) { if (idObject.equals(id)) {
@ -137,7 +135,7 @@ public class DefaultVascFrontendActions implements VascFrontendActions {
/** /**
* @see net.forwardfire.vasc.frontend.VascFrontendActions#mergeObject() * @see net.forwardfire.vasc.frontend.VascFrontendActions#mergeObject()
*/ */
public Object mergeObject() throws VascFrontendException { public Serializable mergeObject() throws VascFrontendException {
try { try {
return saveObject(false); return saveObject(false);
} catch (VascException e) { } catch (VascException e) {
@ -145,7 +143,7 @@ public class DefaultVascFrontendActions implements VascFrontendActions {
} }
} }
protected Object saveObject(boolean persist) throws VascException { protected Serializable saveObject(boolean persist) throws VascException {
try { try {
Serializable object = entry.getVascFrontendController().getVascEntryState().getEntryDataObject(); Serializable object = entry.getVascFrontendController().getVascEntryState().getEntryDataObject();
Serializable result = null; Serializable result = null;
@ -284,7 +282,7 @@ public class DefaultVascFrontendActions implements VascFrontendActions {
entry.getVascFrontendController().getVascFrontend().renderView(); entry.getVascFrontendController().getVascFrontend().renderView();
} }
public void moveUpAction(Object record) throws VascFrontendException { public void moveUpAction(Serializable record) throws VascFrontendException {
if (entry.getVascFrontendController().getVascEntryState().getVascBackend().isRecordMoveable()) { if (entry.getVascFrontendController().getVascEntryState().getVascBackend().isRecordMoveable()) {
try { try {
VascEntryField p = entry.getVascEntryFieldById(entry.getPrimaryKeyFieldId()); VascEntryField p = entry.getVascEntryFieldById(entry.getPrimaryKeyFieldId());
@ -301,7 +299,7 @@ public class DefaultVascFrontendActions implements VascFrontendActions {
entry.getVascFrontendController().getVascFrontend().renderView(); entry.getVascFrontendController().getVascFrontend().renderView();
} }
public void moveDownAction(Object record) throws VascFrontendException { public void moveDownAction(Serializable record) throws VascFrontendException {
if (entry.getVascFrontendController().getVascEntryState().getVascBackend().isRecordMoveable()) { if (entry.getVascFrontendController().getVascEntryState().getVascBackend().isRecordMoveable()) {
try { try {

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl.frontend; package net.forwardfire.vasc.impl.frontend;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -362,7 +363,7 @@ public class DefaultVascFrontendController implements VascFrontendControllerLoca
return list; return list;
} }
public void fireVascFrontendEvent(VascEntry entry,VascFrontendEventType type, Object data) { public void fireVascFrontendEvent(VascEntry entry,VascFrontendEventType type, Serializable data) {
List<VascEntryFrontendEventListener> list = getVascEntryFrontendEventListener(type); List<VascEntryFrontendEventListener> list = getVascEntryFrontendEventListener(type);
for (VascEntryFrontendEventListener l:list) { for (VascEntryFrontendEventListener l:list) {
l.vascEvent(entry, data); l.vascEvent(entry, data);

View file

@ -31,8 +31,6 @@ import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.actions.VascAction; import net.forwardfire.vasc.core.actions.VascAction;
import net.forwardfire.vasc.frontend.VascFrontendDataSelector; import net.forwardfire.vasc.frontend.VascFrontendDataSelector;
import net.forwardfire.vasc.frontend.VascFrontendDataSelector.EntryFieldSelectType;
/** /**
* DefaultVascFrontendDataSelector orders and filters out vasc data. * DefaultVascFrontendDataSelector orders and filters out vasc data.

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl.frontend; package net.forwardfire.vasc.impl.frontend;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -107,7 +108,7 @@ public class DefaultVascFrontendHelper implements VascFrontendHelper {
return error; return error;
} }
Object objectSelected = entry.getVascFrontendController().getVascEntryState().getEntryDataObject(); Serializable objectSelected = entry.getVascFrontendController().getVascEntryState().getEntryDataObject();
try { try {
Object objectValue = field.getVascEntryFieldValue().getValue(field.getBackendName(), objectSelected); Object objectValue = field.getVascEntryFieldValue().getValue(field.getBackendName(), objectSelected);
for (VascEntryFieldValidatorService s:entry.getVascFrontendController().getVascValidatorServices()) { for (VascEntryFieldValidatorService s:entry.getVascFrontendController().getVascValidatorServices()) {
@ -189,12 +190,12 @@ public class DefaultVascFrontendHelper implements VascFrontendHelper {
} }
public String getSelectedDisplayName(VascEntry entry) { public String getSelectedDisplayName(VascEntry entry) {
Object row = entry.getVascFrontendController().getVascEntryState().getEntryDataObject(); Serializable row = entry.getVascFrontendController().getVascEntryState().getEntryDataObject();
if (row==null) { if (row==null) {
return "no-selection"; return "no-selection";
} }
VascEntryField v = entry.getVascEntryFieldById(entry.getDisplayNameFieldId()); VascEntryField v = entry.getVascEntryFieldById(entry.getDisplayNameFieldId());
VascEntryFieldValue ve = v.getVascEntryFieldValue(); VascEntryFieldValue<Serializable> ve = v.getVascEntryFieldValue();
String result = "no-data"; String result = "no-data";
try { try {
result = ve.getDisplayValue(v.getBackendName(), row); result = ve.getDisplayValue(v.getBackendName(), row);
@ -210,12 +211,12 @@ public class DefaultVascFrontendHelper implements VascFrontendHelper {
} }
VascEntry parent = entry.getVascFrontendController().getVascEntryState().getParent().getVascEntry(); VascEntry parent = entry.getVascFrontendController().getVascEntryState().getParent().getVascEntry();
Object row = entry.getVascFrontendController().getVascEntryState().getParent().getEntryDataObject(); Serializable row = entry.getVascFrontendController().getVascEntryState().getParent().getEntryDataObject();
if (row==null) { if (row==null) {
return "no-selection"; return "no-selection";
} }
VascEntryField v = parent.getVascEntryFieldById(parent.getDisplayNameFieldId()); VascEntryField v = parent.getVascEntryFieldById(parent.getDisplayNameFieldId());
VascEntryFieldValue ve = v.getVascEntryFieldValue(); VascEntryFieldValue<Serializable> ve = v.getVascEntryFieldValue();
String result = "no-data"; String result = "no-data";
try { try {
result = ve.getDisplayValue(v.getBackendName(), row); result = ve.getDisplayValue(v.getBackendName(), row);

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl.frontend; package net.forwardfire.vasc.impl.frontend;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -56,7 +57,7 @@ public class DefaultVascFrontendPager implements VascFrontendPageInfo {
VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.POST_READ}; VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.POST_READ};
return result; return result;
} }
public void vascEvent(VascEntry entry, Object data) { public void vascEvent(VascEntry entry, Serializable data) {
pagesAll = getTablePagesFromBackend(); pagesAll = getTablePagesFromBackend();
} }
} }

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl.jndi; package net.forwardfire.vasc.impl.jndi;
import java.io.Serializable;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.List; import java.util.List;
@ -126,7 +127,7 @@ public class JndiVascControllerFactory implements ObjectFactory {
public List<String> getVascBackendIds() { public List<String> getVascBackendIds() {
return backendController.getVascBackendIds(); return backendController.getVascBackendIds();
} }
public VascBackend getVascBackendById(String id) { public VascBackend<Serializable> getVascBackendById(String id) {
return backendController.getVascBackendById(id); return backendController.getVascBackendById(id);
} }
}); });

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl.type; package net.forwardfire.vasc.impl.type;
import java.io.Serializable;
import java.util.List; import java.util.List;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
@ -139,8 +140,8 @@ public class MultiTextVascEntryFieldType extends DefaultVascEntryFieldType {
} }
} }
class MultiVascValueModel extends VascValueModel { class MultiVascValueModel extends VascValueModel {
public Object getValue() throws VascException { public Serializable getValue() throws VascException {
Object value = super.getValue(); Serializable value = super.getValue();
//System.out.println("value: "+value+" type: "+value.getClass()); //System.out.println("value: "+value+" type: "+value.getClass());
StringBuffer buf = new StringBuffer(100); StringBuffer buf = new StringBuffer(100);
if (value instanceof List<?>) { if (value instanceof List<?>) {
@ -164,7 +165,7 @@ class MultiVascValueModel extends VascValueModel {
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void setValue(Object editValueObj) throws VascException { public void setValue(Serializable editValueObj) throws VascException {
if (super.getValue()==null) { if (super.getValue()==null) {
super.setValue(editValueObj); super.setValue(editValueObj);
@ -178,7 +179,7 @@ class MultiVascValueModel extends VascValueModel {
String[] editList = editValue.split(",|\t|\n"); String[] editList = editValue.split(",|\t|\n");
Object value = super.getValue(); Serializable value = super.getValue();
if (value instanceof List<?>) { if (value instanceof List<?>) {
((List<?>)value).clear(); ((List<?>)value).clear();
for (String o:editList) { for (String o:editList) {

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.impl.ui; package net.forwardfire.vasc.impl.ui;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -83,7 +84,7 @@ public class VascSelectItemModelEntry implements VascSelectItemModel {
// set frontend data for new clone, we need te get better lifecycle management for stats/entry/etc // set frontend data for new clone, we need te get better lifecycle management for stats/entry/etc
entry.setVascFrontendController(currentEntry.getVascFrontendController()); entry.setVascFrontendController(currentEntry.getVascFrontendController());
VascBackend back = currentEntry.getVascFrontendController().getVascController().getVascEntryConfigController().configVascBackendProxied(currentEntry.getVascFrontendController().getVascController(), entry); VascBackend<Serializable> back = currentEntry.getVascFrontendController().getVascController().getVascEntryConfigController().configVascBackendProxied(currentEntry.getVascFrontendController().getVascController(), entry);
try { try {
if (nullLabel!=null) { if (nullLabel!=null) {
if (nullKeyValue==null) { if (nullKeyValue==null) {
@ -135,9 +136,9 @@ public class VascSelectItemModelEntry implements VascSelectItemModel {
} }
VascEntryField field = fieldOrg.clone(); VascEntryField field = fieldOrg.clone();
field.getVascValidators().clear(); field.getVascValidators().clear();
VascEntryFieldValue v = fieldEntry.getVascFrontendController().getVascEntryState().getVascBackend().provideVascEntryFieldValue(); VascEntryFieldValue<Serializable> v = fieldEntry.getVascFrontendController().getVascEntryState().getVascBackend().provideVascEntryFieldValue();
Object record = fieldEntry.getVascFrontendController().getVascEntryState().getEntryDataObject(); Serializable record = fieldEntry.getVascFrontendController().getVascEntryState().getEntryDataObject();
if (record==null) { if (record==null) {
//System.out.println("could not get selected records from state."); //System.out.println("could not get selected records from state.");
continue; continue;
@ -155,7 +156,7 @@ public class VascSelectItemModelEntry implements VascSelectItemModel {
VascEntryField fieldClone = key.clone(); VascEntryField fieldClone = key.clone();
fieldClone.getVascValidators().clear(); fieldClone.getVascValidators().clear();
VascEntryFieldValue v = currentEntry.getVascFrontendController().getVascEntryState().getVascBackend().provideVascEntryFieldValue(); VascEntryFieldValue<Serializable> v = currentEntry.getVascFrontendController().getVascEntryState().getVascBackend().provideVascEntryFieldValue();
key.setVascEntryFieldValue(v); key.setVascEntryFieldValue(v);
} }
if (dis.getVascEntryFieldValue()==null) { if (dis.getVascEntryFieldValue()==null) {
@ -163,14 +164,14 @@ public class VascSelectItemModelEntry implements VascSelectItemModel {
VascEntryField fieldClone = dis.clone(); VascEntryField fieldClone = dis.clone();
fieldClone.getVascValidators().clear(); fieldClone.getVascValidators().clear();
VascEntryFieldValue v = currentEntry.getVascFrontendController().getVascEntryState().getVascBackend().provideVascEntryFieldValue(); VascEntryFieldValue<Serializable> v = currentEntry.getVascFrontendController().getVascEntryState().getVascBackend().provideVascEntryFieldValue();
dis.setVascEntryFieldValue(v); dis.setVascEntryFieldValue(v);
} }
// execute // execute
for (Object o:back.execute(state)) { for (Serializable o:back.execute(state)) {
Object keyId = key.getVascEntryFieldValue().getValue(key.getBackendName(), o); Serializable keyId = key.getVascEntryFieldValue().getValue(key.getBackendName(), o);
String nameId = dis.getVascEntryFieldValue().getDisplayValue(dis.getBackendName(), o); String nameId = dis.getVascEntryFieldValue().getDisplayValue(dis.getBackendName(), o);
if (returnKeyValue!=null && false==returnKeyValue) { if (returnKeyValue!=null && false==returnKeyValue) {
VascSelectItem item = new VascSelectItem(nameId,o,""+keyId); VascSelectItem item = new VascSelectItem(nameId,o,""+keyId);

View file

@ -23,6 +23,7 @@
package net.forwardfire.vasc.impl.x4o; package net.forwardfire.vasc.impl.x4o;
import java.io.IOException; import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader; import java.io.StringReader;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Calendar; import java.util.Calendar;
@ -33,7 +34,6 @@ import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import net.forwardfire.vasc.annotations.VascAnnotationParser; import net.forwardfire.vasc.annotations.VascAnnotationParser;
import net.forwardfire.vasc.annotations.VascChoices; import net.forwardfire.vasc.annotations.VascChoices;
import net.forwardfire.vasc.annotations.VascChoicesSelectItemModel; import net.forwardfire.vasc.annotations.VascChoicesSelectItemModel;
@ -377,13 +377,13 @@ public class AnnotationParserElement extends AbstractElement {
Class<?> retType = methodCall.getReturnType(); Class<?> retType = methodCall.getReturnType();
try { try {
//System.out.println("creating real def value of: "+defValue+" for: "+retType.getName()); //System.out.println("creating real def value of: "+defValue+" for: "+retType.getName());
Object defObject = null; Serializable defObject = null;
if (Date.class.equals(retType)) { if (Date.class.equals(retType)) {
defObject = new Date(); defObject = new Date();
} else if (Calendar.class.equals(retType)) { } else if (Calendar.class.equals(retType)) {
defObject = Calendar.getInstance(); defObject = Calendar.getInstance();
} else { } else {
defObject = retType.getConstructor(String.class).newInstance(defValue); defObject = (Serializable) retType.getConstructor(String.class).newInstance(defValue);
} }
//System.out.println("real object: "+defObject); //System.out.println("real object: "+defObject);
field.setDefaultValue(defObject); field.setDefaultValue(defObject);

View file

@ -23,10 +23,7 @@
package net.forwardfire.vasc.impl.x4o; package net.forwardfire.vasc.impl.x4o;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.VascEntryFieldLocal;
import net.forwardfire.vasc.core.VascEntryFieldType; import net.forwardfire.vasc.core.VascEntryFieldType;
import net.forwardfire.vasc.core.VascEntryListOptionLocal;
import net.forwardfire.vasc.core.VascEntryLocal;
import net.forwardfire.vasc.core.ui.VascSelectItemModel; import net.forwardfire.vasc.core.ui.VascSelectItemModel;
import org.x4o.xml.element.AbstractElementBindingHandler; import org.x4o.xml.element.AbstractElementBindingHandler;

View file

@ -23,6 +23,8 @@
package net.forwardfire.vasc.impl.x4o; package net.forwardfire.vasc.impl.x4o;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackend; import net.forwardfire.vasc.backend.VascBackend;
import net.forwardfire.vasc.backend.VascBackendController; import net.forwardfire.vasc.backend.VascBackendController;
import net.forwardfire.vasc.backend.VascBackendControllerLocal; import net.forwardfire.vasc.backend.VascBackendControllerLocal;
@ -46,7 +48,8 @@ public class VascBackendElementConfigurator extends AbstractElementConfigurator
*/ */
public void doConfigElement(Element element) throws ElementConfiguratorException { public void doConfigElement(Element element) throws ElementConfiguratorException {
VascBackend backend = (VascBackend)element.getElementObject(); @SuppressWarnings("unchecked")
VascBackend<Serializable> backend = (VascBackend<Serializable>)element.getElementObject();
VascController vascController = VascDriver.getVascController(element.getLanguageSession()); VascController vascController = VascDriver.getVascController(element.getLanguageSession());
VascBackendController backendController = vascController.getVascBackendController(); VascBackendController backendController = vascController.getVascBackendController();

View file

@ -32,6 +32,8 @@ import java.util.Date;
* @version 1.0 Sep 5, 2008 * @version 1.0 Sep 5, 2008
*/ */
public class VascDateFutureValidator implements VascValidator { public class VascDateFutureValidator implements VascValidator {
private static final long serialVersionUID = -8779126994191323884L;
/** /**
* @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object) * @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object)

View file

@ -32,7 +32,9 @@ import java.util.Date;
* @version 1.0 Sep 5, 2008 * @version 1.0 Sep 5, 2008
*/ */
public class VascDatePastValidator implements VascValidator { public class VascDatePastValidator implements VascValidator {
private static final long serialVersionUID = 74015638500286753L;
/** /**
* @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object) * @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object)
*/ */

View file

@ -31,7 +31,8 @@ import java.lang.annotation.Annotation;
* @version 1.0 Sep 5, 2008 * @version 1.0 Sep 5, 2008
*/ */
public class VascIntSizeValidator implements VascValidator { public class VascIntSizeValidator implements VascValidator {
private static final long serialVersionUID = 5208748030708077917L;
private int max = Integer.MAX_VALUE; private int max = Integer.MAX_VALUE;
private int min = Integer.MIN_VALUE; private int min = Integer.MIN_VALUE;

View file

@ -32,6 +32,7 @@ import java.lang.annotation.Annotation;
*/ */
public class VascLongSizeValidator implements VascValidator { public class VascLongSizeValidator implements VascValidator {
private static final long serialVersionUID = -4030130692127481134L;
private long max = Long.MAX_VALUE; private long max = Long.MAX_VALUE;
private long min = Long.MIN_VALUE; private long min = Long.MIN_VALUE;

View file

@ -31,7 +31,9 @@ import java.lang.annotation.Annotation;
* @version 1.0 Sep 5, 2008 * @version 1.0 Sep 5, 2008
*/ */
public class VascObjectNotNullValidator implements VascValidator { public class VascObjectNotNullValidator implements VascValidator {
private static final long serialVersionUID = 224078383059443142L;
/** /**
* @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object) * @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object)
*/ */

View file

@ -31,7 +31,9 @@ import java.lang.annotation.Annotation;
* @version 1.0 Sep 5, 2008 * @version 1.0 Sep 5, 2008
*/ */
public class VascObjectNullValidator implements VascValidator { public class VascObjectNullValidator implements VascValidator {
private static final long serialVersionUID = 150805733891675721L;
/** /**
* @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object) * @see net.forwardfire.vasc.validators.VascValidator#isObjectValid(java.lang.Object)
*/ */

View file

@ -36,6 +36,7 @@ import java.util.regex.Pattern;
*/ */
public class VascObjectUrlValidator implements VascValidator { public class VascObjectUrlValidator implements VascValidator {
private static final long serialVersionUID = -1539950641644630956L;
private Pattern pattern = null; private Pattern pattern = null;
/** /**

View file

@ -35,6 +35,7 @@ package net.forwardfire.vasc.validators;
*/ */
public class VascStringEmailValidator extends VascStringRegexValidator { public class VascStringEmailValidator extends VascStringRegexValidator {
private static final long serialVersionUID = 6441424565202039568L;
static private final String EMAIL_REGEX = "(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*"; static private final String EMAIL_REGEX = "(\\w+)@(\\w+\\.)(\\w+)(\\.\\w+)*";
/** /**

View file

@ -32,6 +32,7 @@ import java.lang.annotation.Annotation;
*/ */
public class VascStringLengthValidator implements VascValidator { public class VascStringLengthValidator implements VascValidator {
private static final long serialVersionUID = 7676298359239607685L;
private Integer minLenght = 0; private Integer minLenght = 0;
private Integer maxLenght = Integer.MAX_VALUE; private Integer maxLenght = Integer.MAX_VALUE;
private boolean nullable = false; private boolean nullable = false;

View file

@ -33,7 +33,8 @@ import java.util.regex.Pattern;
* @version 1.0 Sep 5, 2008 * @version 1.0 Sep 5, 2008
*/ */
public class VascStringRegexValidator implements VascValidator { public class VascStringRegexValidator implements VascValidator {
private static final long serialVersionUID = -7077554409967479437L;
private Pattern pattern = null; private Pattern pattern = null;
/** /**

View file

@ -46,6 +46,7 @@ package net.forwardfire.vasc.validators;
*/ */
public class VascStringZipCodeValidator extends VascStringRegexValidator { public class VascStringZipCodeValidator extends VascStringRegexValidator {
private static final long serialVersionUID = -8625655465308689744L;
static private final String ZIP_REGEX = "^[0-9]{4}\\s*[a-zA-Z]{2}$"; static private final String ZIP_REGEX = "^[0-9]{4}\\s*[a-zA-Z]{2}$";
/** /**

View file

@ -24,6 +24,7 @@ package net.forwardfire.vasc.export.generic;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -66,7 +67,7 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
int dataSize = entry.getVascFrontendController().getVascEntryState().getEntryDataList().size(); int dataSize = entry.getVascFrontendController().getVascEntryState().getEntryDataList().size();
for (int dataIndex=0;dataIndex<dataSize;dataIndex++) { for (int dataIndex=0;dataIndex<dataSize;dataIndex++) {
Object o = entry.getVascFrontendController().getVascEntryState().getEntryDataList().get(dataIndex); Serializable o = entry.getVascFrontendController().getVascEntryState().getEntryDataList().get(dataIndex);
doExportRowStart(o); doExportRowStart(o);
try { try {
doExportRowFields(o); doExportRowFields(o);
@ -96,10 +97,10 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
abstract protected void doExportStart() throws IOException; abstract protected void doExportStart() throws IOException;
abstract protected void doExportEnd() throws IOException; abstract protected void doExportEnd() throws IOException;
abstract protected void doExportRowStart(Object row) throws IOException; abstract protected void doExportRowStart(Serializable row) throws IOException;
abstract protected void doExportRowEnd(Object row,boolean isLast) throws IOException; abstract protected void doExportRowEnd(Serializable row,boolean isLast) throws IOException;
protected void doExportRowFields(Object row) throws IOException,VascBackendException { protected void doExportRowFields(Serializable row) throws IOException,VascBackendException {
// todo: rm me and use data selector // todo: rm me and use data selector
List<VascEntryField> fieldList = new ArrayList<VascEntryField>(getVascEntry().getVascEntryFields()); List<VascEntryField> fieldList = new ArrayList<VascEntryField>(getVascEntry().getVascEntryFields());
int fields = fieldList.size(); int fields = fieldList.size();
@ -109,5 +110,5 @@ abstract public class AbstractVascEntryExportWriter implements VascEntryExportWr
} }
} }
abstract protected void doExportRowField(Object row,VascEntryField field,boolean isLast) throws IOException,VascBackendException; abstract protected void doExportRowField(Serializable row,VascEntryField field,boolean isLast) throws IOException,VascBackendException;
} }

View file

@ -24,6 +24,7 @@ package net.forwardfire.vasc.export.generic;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
@ -122,17 +123,17 @@ public class VascEntryExportWriterCsv extends AbstractVascEntryExportWriter {
} }
@Override @Override
protected void doExportRowStart(Object row) { protected void doExportRowStart(Serializable row) {
} }
@Override @Override
protected void doExportRowEnd(Object row,boolean isLast) { protected void doExportRowEnd(Serializable row,boolean isLast) {
p.write(lineEnd.toCharType()); p.write(lineEnd.toCharType());
p.flush(); p.flush();
} }
@Override @Override
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascBackendException { protected void doExportRowField(Serializable o, VascEntryField c,boolean isLast) throws VascBackendException {
p.write(quoteChar.toCharType()); p.write(quoteChar.toCharType());
p.write(c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o)); p.write(c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));
p.write(quoteChar.toCharType()); p.write(quoteChar.toCharType());

View file

@ -24,6 +24,7 @@ package net.forwardfire.vasc.export.generic;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
@ -63,18 +64,18 @@ public class VascEntryExportWriterXml extends AbstractVascEntryExportWriter {
} }
@Override @Override
protected void doExportRowStart(Object row) { protected void doExportRowStart(Serializable row) {
p.write("\t<row>\n"); p.write("\t<row>\n");
} }
@Override @Override
protected void doExportRowEnd(Object row,boolean isLast) { protected void doExportRowEnd(Serializable row,boolean isLast) {
p.write("\t</row>\n"); p.write("\t</row>\n");
p.flush(); p.flush();
} }
@Override @Override
protected void doExportRowField(Object o, VascEntryField c,boolean isLast) throws VascBackendException { protected void doExportRowField(Serializable o, VascEntryField c,boolean isLast) throws VascBackendException {
if (xmlTree) { if (xmlTree) {
p.write("\t\t<"+c.getId()+"><![CDATA["); p.write("\t\t<"+c.getId()+"><![CDATA[");
p.write(""+c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o)); p.write(""+c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.export.jr4o; package net.forwardfire.vasc.export.jr4o;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -72,7 +73,7 @@ public class JRDynamicDataSourceVascEntry extends AbstractJRDynamicDataSource {
for (int page=0;page<=pages;page++) { for (int page=0;page<=pages;page++) {
vascEntry.getVascFrontendController().getVascEntryState().getVascBackendState().setPageIndex(page); vascEntry.getVascFrontendController().getVascEntryState().getVascBackendState().setPageIndex(page);
vascEntry.getVascFrontendController().getVascFrontendActions().refreshData(); vascEntry.getVascFrontendController().getVascFrontendActions().refreshData();
for (Object o:vascEntry.getVascFrontendController().getVascEntryState().getEntryDataList()) { for (Serializable o:vascEntry.getVascFrontendController().getVascEntryState().getEntryDataList()) {
List<String> row = new ArrayList<String>(30); List<String> row = new ArrayList<String>(30);
for (VascEntryField c:fields) { for (VascEntryField c:fields) {
row.add(c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o)); row.add(c.getVascEntryFieldValue().getDisplayValue(c.getBackendName(), o));

View file

@ -25,6 +25,7 @@ package net.forwardfire.vasc.export.json;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -92,12 +93,12 @@ public class VascEntryExportWriterJson extends AbstractVascEntryExportWriter {
} }
@Override @Override
protected void doExportRowStart(Object row) { protected void doExportRowStart(Serializable row) {
rowData.clear(); rowData.clear();
} }
@Override @Override
protected void doExportRowEnd(Object row,boolean isLast) throws IOException { protected void doExportRowEnd(Serializable row,boolean isLast) throws IOException {
JSONObject.writeJSONString(rowData, p); JSONObject.writeJSONString(rowData, p);
if (isLast==false) { if (isLast==false) {
p.write(","); p.write(",");
@ -107,7 +108,7 @@ public class VascEntryExportWriterJson extends AbstractVascEntryExportWriter {
} }
@Override @Override
protected void doExportRowField(Object row, VascEntryField field,boolean isLast) throws VascBackendException { protected void doExportRowField(Serializable row, VascEntryField field,boolean isLast) throws VascBackendException {
String key = field.getId(); String key = field.getId();
Object data = field.getVascEntryFieldValue().getValue(field.getBackendName(), row); Object data = field.getVascEntryFieldValue().getValue(field.getBackendName(), row);
rowData.put(key, data); rowData.put(key, data);

View file

@ -25,6 +25,7 @@ package net.forwardfire.vasc.frontend.swing;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.Serializable;
import java.util.List; import java.util.List;
import javax.swing.JComboBox; import javax.swing.JComboBox;
@ -158,7 +159,7 @@ public class SwingActionPanel extends JPanel implements VascEntryFrontendEventLi
return result; return result;
} }
public void vascEvent(VascEntry entry,Object dataNotUsed) { public void vascEvent(VascEntry entry,Serializable dataNotUsed) {
init = true; init = true;

View file

@ -25,6 +25,7 @@ package net.forwardfire.vasc.frontend.swing;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.Serializable;
import java.util.List; import java.util.List;
import javax.swing.JButton; import javax.swing.JButton;
@ -81,7 +82,7 @@ public class SwingPagerPanel extends JPanel implements VascEntryFrontendEventLis
} }
} }
public void vascEvent(VascEntry entry, Object data) { public void vascEvent(VascEntry entry, Serializable data) {
for(Component c:result.getComponents()) { for(Component c:result.getComponents()) {
if (c instanceof JButton) { if (c instanceof JButton) {

View file

@ -24,6 +24,7 @@ package net.forwardfire.vasc.frontend.swing;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -69,7 +70,7 @@ public class SwingPanelFrame implements SwingPanelIntegration {
entry.getVascFrontendController().addVascEntryFrontendEventListener(new VascEntryFrontendEventListener() { entry.getVascFrontendController().addVascEntryFrontendEventListener(new VascEntryFrontendEventListener() {
private static final long serialVersionUID = -6801954395965101748L; private static final long serialVersionUID = -6801954395965101748L;
public void vascEvent(VascEntry entry, Object data) { public void vascEvent(VascEntry entry, Serializable data) {
if (data instanceof Exception) { if (data instanceof Exception) {
Exception e = (Exception)data; Exception e = (Exception)data;
e.printStackTrace(); e.printStackTrace();

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.frontend.swing; package net.forwardfire.vasc.frontend.swing;
import java.io.Serializable;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTabbedPane; import javax.swing.JTabbedPane;
@ -56,7 +58,7 @@ public class SwingPanelTabbed implements SwingPanelIntegration {
entry.getVascFrontendController().addVascEntryFrontendEventListener(new VascEntryFrontendEventListener() { entry.getVascFrontendController().addVascEntryFrontendEventListener(new VascEntryFrontendEventListener() {
private static final long serialVersionUID = -6801954395965101748L; private static final long serialVersionUID = -6801954395965101748L;
public void vascEvent(VascEntry entry, Object data) { public void vascEvent(VascEntry entry, Serializable data) {
if (data instanceof Exception) { if (data instanceof Exception) {
Exception e = (Exception)data; Exception e = (Exception)data;
e.printStackTrace(); e.printStackTrace();

View file

@ -105,7 +105,7 @@ public class SwingVascEditDialog extends JPanel {
// Set parameters // Set parameters
try { try {
Object selected = bean; Serializable selected = bean;
for (String parameterName:vle.getEntryParameterFieldIdKeys()) { for (String parameterName:vle.getEntryParameterFieldIdKeys()) {
String fieldId = vle.getEntryParameterFieldId(parameterName); String fieldId = vle.getEntryParameterFieldId(parameterName);
VascEntryField v = entry.getVascEntryFieldById(fieldId); VascEntryField v = entry.getVascEntryFieldById(fieldId);

View file

@ -187,7 +187,7 @@ public class SwingVascFrontend extends AbstractVascFrontend {
} }
public void renderDelete() throws VascFrontendException { public void renderDelete() throws VascFrontendException {
Object rowBean = entry.getVascFrontendController().getVascEntryState().getEntryDataObject(); Serializable rowBean = entry.getVascFrontendController().getVascEntryState().getEntryDataObject();
String beanValue = rowBean.toString(); String beanValue = rowBean.toString();
try { try {

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.frontend.swing; package net.forwardfire.vasc.frontend.swing;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -47,7 +48,7 @@ public class SwingVascTableModel extends AbstractTableModel implements VascEntry
entry.getVascFrontendController().addVascEntryFrontendEventListener(this); entry.getVascFrontendController().addVascEntryFrontendEventListener(this);
} }
public void vascEvent(VascEntry entry,Object o) { public void vascEvent(VascEntry entry,Serializable o) {
fireTableDataChanged(); fireTableDataChanged();
} }
@ -79,7 +80,7 @@ public class SwingVascTableModel extends AbstractTableModel implements VascEntry
* @see javax.swing.entry.entryModel#getValueAt(int, int) * @see javax.swing.entry.entryModel#getValueAt(int, int)
*/ */
public Object getValueAt(int rowIndex, int columnIndex) { public Object getValueAt(int rowIndex, int columnIndex) {
Object bean = entry.getVascFrontendController().getVascEntryState().getEntryDataList().get(rowIndex); Serializable bean = entry.getVascFrontendController().getVascEntryState().getEntryDataList().get(rowIndex);
// TODO: this is slowing.... // TODO: this is slowing....
List<VascEntryField> list = new ArrayList<VascEntryField>(); List<VascEntryField> list = new ArrayList<VascEntryField>();

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.frontend.swt; package net.forwardfire.vasc.frontend.swt;
import java.io.Serializable;
import java.util.List; import java.util.List;
import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntry;
@ -125,7 +126,7 @@ public class SwtActionPanel implements VascEntryFrontendEventListener {
return result; return result;
} }
public void vascEvent(VascEntry entry,Object dataNotUsed) { public void vascEvent(VascEntry entry,Serializable dataNotUsed) {
vascEvent = true; vascEvent = true;
long pageSize = entry.getVascFrontendController().getVascFrontendPageInfo().getPageSize(); long pageSize = entry.getVascFrontendController().getVascFrontendPageInfo().getPageSize();

View file

@ -22,6 +22,7 @@
package net.forwardfire.vasc.frontend.swt; package net.forwardfire.vasc.frontend.swt;
import java.io.Serializable;
import java.util.List; import java.util.List;
import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntry;
@ -76,7 +77,7 @@ public class SwtPagerPanel implements VascEntryFrontendEventListener {
return result; return result;
} }
public void vascEvent(VascEntry entry,Object dataNotUsed) { public void vascEvent(VascEntry entry,Serializable dataNotUsed) {
} }
} }

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.frontend.swt; package net.forwardfire.vasc.frontend.swt;
import java.io.Serializable;
import net.forwardfire.vasc.backend.VascBackendException; import net.forwardfire.vasc.backend.VascBackendException;
import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
@ -125,7 +127,7 @@ public class SwtVascEditDialog extends Dialog {
} }
String name = null; String name = null;
try { try {
Object bean = entry.getVascFrontendController().getVascEntryState().getEntryDataObject(); Serializable bean = entry.getVascFrontendController().getVascEntryState().getEntryDataObject();
name = dis.getVascEntryFieldValue().getDisplayValue(dis.getBackendName(), bean); name = dis.getVascEntryFieldValue().getDisplayValue(dis.getBackendName(), bean);
} catch (VascBackendException e) { } catch (VascBackendException e) {
throw new RuntimeException("Could not display value from "+entry.getId(),e); throw new RuntimeException("Could not display value from "+entry.getId(),e);
@ -156,7 +158,7 @@ public class SwtVascEditDialog extends Dialog {
public void createBody(Composite body) throws VascException { public void createBody(Composite body) throws VascException {
body.setLayout(new GridLayout(2, true)); body.setLayout(new GridLayout(2, true));
body.setLayoutData(new GridData(GridData.FILL_BOTH)); body.setLayoutData(new GridData(GridData.FILL_BOTH));
Object bean = entry.getVascFrontendController().getVascEntryState().getEntryDataObject(); Serializable bean = entry.getVascFrontendController().getVascEntryState().getEntryDataObject();
entry.getVascFrontendController().clearFieldRenderObjects(); // only needed for swt use entry.getVascFrontendController().clearFieldRenderObjects(); // only needed for swt use

View file

@ -478,7 +478,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.POST_READ}; VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.POST_READ};
return result; return result;
} }
public void vascEvent(VascEntry entry,Object data) { public void vascEvent(VascEntry entry,Serializable data) {
tableViewer.refresh(); tableViewer.refresh();
table2.deselectAll(); table2.deselectAll();
} }
@ -638,7 +638,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
//if (vtc.getVascColumnRenderer()==null) { //if (vtc.getVascColumnRenderer()==null) {
try { try {
return vtc.getVascEntryFieldValue().getDisplayValue(vtc.getBackendName(),bean); return vtc.getVascEntryFieldValue().getDisplayValue(vtc.getBackendName(),(Serializable) bean);
} catch (Exception e) { } catch (Exception e) {
logger.log(Level.WARNING,"Error in get value: '"+vtc.getVascEntryFieldValue()+"' error: "+e.getMessage(),e); logger.log(Level.WARNING,"Error in get value: '"+vtc.getVascEntryFieldValue()+"' error: "+e.getMessage(),e);
return "Err"; return "Err";

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.frontend.swt.ui; package net.forwardfire.vasc.frontend.swt.ui;
import java.io.Serializable;
import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.ui.VascUIComponent; import net.forwardfire.vasc.core.ui.VascUIComponent;
@ -72,7 +74,7 @@ public class SwtText implements VascUIComponent {
} }
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
Object value = text.getText(); Serializable value = text.getText();
try { try {
model.setValue(value); model.setValue(value);
} catch (VascException ve) { } catch (VascException ve) {

View file

@ -22,6 +22,8 @@
package net.forwardfire.vasc.frontend.swt.ui; package net.forwardfire.vasc.frontend.swt.ui;
import java.io.Serializable;
import net.forwardfire.vasc.core.VascEntry; import net.forwardfire.vasc.core.VascEntry;
import net.forwardfire.vasc.core.VascEntryField; import net.forwardfire.vasc.core.VascEntryField;
import net.forwardfire.vasc.core.ui.VascUIComponent; import net.forwardfire.vasc.core.ui.VascUIComponent;
@ -96,7 +98,7 @@ public class SwtTextArea implements VascUIComponent {
} }
public void modifyText(ModifyEvent e) { public void modifyText(ModifyEvent e) {
Object value = text.getText(); Serializable value = text.getText();
try { try {
model.setValue(value); model.setValue(value);
} catch (VascException ve) { } catch (VascException ve) {

View file

@ -62,7 +62,7 @@ public class JSFVascEntryEventListener implements VascEntryFrontendEventListener
public void vascEvent(VascEntry entry,Object dataNotUsed) { public void vascEvent(VascEntry entry,Serializable dataNotUsed) {
/* moved to fillVascEntryFrontend /* moved to fillVascEntryFrontend
try { try {
for (VascEntryField field:entry.getVascEntryFields()) { for (VascEntryField field:entry.getVascEntryFields()) {

View file

@ -584,7 +584,7 @@ public class JSFVascEntrySupportBean implements Serializable {
logger.fine("moveAction"); logger.fine("moveAction");
String moveAction = getComponentType(event.getComponent()); String moveAction = getComponentType(event.getComponent());
JSFVascUIComponent comp = JSFVascUIComponent.findVascParent(event.getComponent()); JSFVascUIComponent comp = JSFVascUIComponent.findVascParent(event.getComponent());
Object selected = comp.getSupportBean().getSelectedTableRecord().getRecord(); Serializable selected = comp.getSupportBean().getSelectedTableRecord().getRecord();
if ("up".equals(moveAction)) { if ("up".equals(moveAction)) {
entry.getVascFrontendController().getVascFrontendActions().moveUpAction(selected); entry.getVascFrontendController().getVascFrontendActions().moveUpAction(selected);
} }

View file

@ -339,7 +339,7 @@ public class JSFVascUIComponent extends UIComponentBase {
// Set parameters // Set parameters
try { try {
Object selected = getSupportBean().getSelected().getRecord(); Serializable selected = getSupportBean().getSelected().getRecord();
for (String parameterName:link.getEntryParameterFieldIdKeys()) { for (String parameterName:link.getEntryParameterFieldIdKeys()) {
String fieldId = link.getEntryParameterFieldId(parameterName); String fieldId = link.getEntryParameterFieldId(parameterName);
VascEntryField v = getVascEntry().getVascEntryFieldById(fieldId); VascEntryField v = getVascEntry().getVascEntryFieldById(fieldId);
@ -361,7 +361,7 @@ public class JSFVascUIComponent extends UIComponentBase {
for (String fieldId:link.getEntryCreateFieldValueKeys()) { for (String fieldId:link.getEntryCreateFieldValueKeys()) {
String selectedfieldId = link.getEntryParameterFieldId(fieldId); String selectedfieldId = link.getEntryParameterFieldId(fieldId);
Object selectedValue = selected; Serializable selectedValue = selected;
if (selectedfieldId!=null) { if (selectedfieldId!=null) {
VascEntryField v = getVascEntry().getVascEntryFieldById(selectedfieldId); VascEntryField v = getVascEntry().getVascEntryFieldById(selectedfieldId);
selectedValue = v.getVascEntryFieldValue().getValue(v.getBackendName(), selected); selectedValue = v.getVascEntryFieldValue().getValue(v.getBackendName(), selected);
@ -385,8 +385,8 @@ public class JSFVascUIComponent extends UIComponentBase {
class CreateEntryFieldValuesListener2 implements VascEntryFrontendEventListener { class CreateEntryFieldValuesListener2 implements VascEntryFrontendEventListener {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String fieldId = null; private String fieldId = null;
private Object value = null; private Serializable value = null;
public CreateEntryFieldValuesListener2(String fieldId,Object value) { public CreateEntryFieldValuesListener2(String fieldId,Serializable value) {
if (fieldId==null) { if (fieldId==null) {
throw new NullPointerException("fieldId may not be null"); throw new NullPointerException("fieldId may not be null");
} }
@ -397,7 +397,7 @@ public class JSFVascUIComponent extends UIComponentBase {
VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.PRE_CREATE}; VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.PRE_CREATE};
return result; return result;
} }
public void vascEvent(VascEntry entry,Object data) { public void vascEvent(VascEntry entry,Serializable data) {
VascEntryField field = entry.getVascEntryFieldById(fieldId); VascEntryField field = entry.getVascEntryFieldById(fieldId);
try { try {
field.getVascEntryFieldValue().setValue(field.getBackendName(), data, value); field.getVascEntryFieldValue().setValue(field.getBackendName(), data, value);

View file

@ -346,7 +346,7 @@ public class JSFVascUIComponentRenderer extends Renderer {
} }
public void processValueChange(ValueChangeEvent event) throws AbortProcessingException { public void processValueChange(ValueChangeEvent event) throws AbortProcessingException {
try { try {
model.setValue(event.getNewValue()); model.setValue((Serializable)event.getNewValue());
} catch (VascException e) { } catch (VascException e) {
throw new AbortProcessingException(e); throw new AbortProcessingException(e);
} }

View file

@ -92,8 +92,8 @@ public class VascDataBackendBean implements Serializable {
private void setValue(int index,Object valueObject) { private void setValue(int index,Object valueObject) {
try { try {
VascEntryField field = getFieldIdByIndex(entry,index); VascEntryField field = getFieldIdByIndex(entry,index);
VascEntryFieldValue value = field.getVascEntryFieldValue(); VascEntryFieldValue<Serializable> value = field.getVascEntryFieldValue();
value.setValue(field.getBackendName(), record,valueObject); value.setValue(field.getBackendName(), record,(Serializable)valueObject); // TODO: rm cast
} catch (VascBackendException e) { } catch (VascBackendException e) {
throw new RuntimeException("Could not set value on record.",e); throw new RuntimeException("Could not set value on record.",e);
} }