|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.peer.LyRequestEncoder
leon.peer.file.LyFileRequestEncoder
leon.peer.xml.LyXmlRequestEncoder
public class LyXmlRequestEncoder
This class is used for local files as data provider. Methods for creation, deletion and modification are not overriden since they don't have to write anything in the corresponding files. The specific method saveObjects must be called in order to make the objects persistent in a file.
LyRequestEncoder
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static int |
TYPE_DEFAULT
Saving type : only default yet ,but here to keep file save cmpatibility and for further extension. |
Fields inherited from class leon.peer.file.LyFileRequestEncoder |
---|
_environment, _fieldSep, _valueSep, EMPTY_CHARSET, EXPORT_ENCODING, RAW_ENCODING, SPREADSHEET_ENCODING, TEXT_ENCODING, XML_EXPORT_ENCODING |
Constructor Summary | |
---|---|
LyXmlRequestEncoder(LyDataProvider provider,
LyDataSource dataSource,
java.lang.String fieldSep,
java.lang.String valueSep)
Constructor. |
Method Summary | |
---|---|
org.xml.sax.helpers.DefaultHandler |
buildHandler()
Return the default handler for this provider. |
org.xml.sax.InputSource |
convertSourceVersion(org.xml.sax.InputSource source)
Apply any transformation (like XSLT Stylesheets to convert the source version of the XML File to latest version current implementation does nothing : should be overriden in subclasses. |
boolean |
createObject(java.lang.Object object)
To create a new object. |
boolean |
deleteObject(java.lang.Object object)
To delete an object. |
java.lang.String |
encodeValue(LyValueSet values,
java.util.Vector<LyField> fields,
int type)
Return a line describing the ValueSet. |
java.util.Vector<java.lang.String> |
encodeValues(java.util.Vector<java.lang.Object> objects,
java.util.Vector<LyField> fields,
int type)
Read a set of lines and return a set of objects. |
boolean |
getObject(LyObjectId objectId,
java.util.Vector<LyField> fields)
Get an object. |
boolean |
getObjects(java.util.Vector<LyField> fields,
LySort sort,
LyFilter filter,
int n)
Get a set of objects. |
boolean |
getSize()
Return the number of objects from the file. |
boolean |
getSize(LyFilter filter)
Return the number of objects from the file . |
void |
init()
Initialisation of the data of the instance. |
boolean |
saveObjects(java.util.Vector<java.lang.Object> objects,
java.util.Vector<LyField> fields,
int type)
Method used to saved all the objects contained in the corresponding data source cache. |
boolean |
setObject(java.lang.Object object)
To set an object. |
boolean |
setObjects(java.util.Vector<java.lang.Object> objects)
To set a set of objects. |
void |
setResponse(LyResponse response)
Set the request encoder response. |
boolean |
writeToConnection(java.util.Vector<java.lang.Object> objects,
java.util.Vector<LyField> fields,
int type)
Sends a request to the file connection for writing data. |
boolean |
writeToConnection(java.util.Vector<java.lang.String> lines)
Sends a request to the file connection for writing data. |
Methods inherited from class leon.peer.file.LyFileRequestEncoder |
---|
asciiEncode, decodeHeader, decodeValue, decodeValues, decodeValues, encodeHeader, encodeValue, fromString, fromString, getEnvironment, getFieldSeparator, getValueSeparator, readFromConnection, setEnvironment, setHeaderMark |
Methods inherited from class leon.peer.LyRequestEncoder |
---|
deleteObjects, getClassBinding, getDataClass, getProvider, getResponse, isSynchronous, loadObject, setClassBinding, setDataClass, toString, toString, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final int TYPE_DEFAULT
Constructor Detail |
---|
public LyXmlRequestEncoder(LyDataProvider provider, LyDataSource dataSource, java.lang.String fieldSep, java.lang.String valueSep)
fieldSep
- separator used between fields.valuedSep
- separator used between values.Method Detail |
---|
public void init()
init
in class LyFileRequestEncoder
public void setResponse(LyResponse response)
setResponse
in class LyFileRequestEncoder
the
- responsepublic boolean getObject(LyObjectId objectId, java.util.Vector<LyField> fields)
getObject
in class LyFileRequestEncoder
objectId
- object identifierfields
- the fields to load (if null, load all)
public boolean getObjects(java.util.Vector<LyField> fields, LySort sort, LyFilter filter, int n)
getObjects
in class LyFileRequestEncoder
fields
- the fields to load (if null, load all)sort
- indicates sorting criterion, or null if default sort is used.filter
- indicates filtering criterion, or null if there is no filter.n
- maximum number of objects to get.
public boolean getSize()
getSize
in class LyFileRequestEncoder
public boolean getSize(LyFilter filter)
getSize
in class LyFileRequestEncoder
filter
- indicates filtering criterion, or null if there is no filter.
public boolean createObject(java.lang.Object object)
createObject
in class LyFileRequestEncoder
object
- the new object to create
public boolean setObject(java.lang.Object object)
setObject
in class LyFileRequestEncoder
object
- the object to set
public boolean setObjects(java.util.Vector<java.lang.Object> objects)
setObjects
in class LyFileRequestEncoder
objects
- the objects to set
public boolean deleteObject(java.lang.Object object)
deleteObject
in class LyFileRequestEncoder
object
- the object to delete
public org.xml.sax.InputSource convertSourceVersion(org.xml.sax.InputSource source)
input
- source for parsing (input version)
public org.xml.sax.helpers.DefaultHandler buildHandler()
public boolean saveObjects(java.util.Vector<java.lang.Object> objects, java.util.Vector<LyField> fields, int type)
saveObjects
in class LyFileRequestEncoder
fields
- fields to save (if null save all).type
- indicates the file format
public java.util.Vector<java.lang.String> encodeValues(java.util.Vector<java.lang.Object> objects, java.util.Vector<LyField> fields, int type)
encodeValues
in class LyFileRequestEncoder
objects
- the set of objects to encode.fields
- FieldInfos to save (if null save all).type
- indicates the file format.
public java.lang.String encodeValue(LyValueSet values, java.util.Vector<LyField> fields, int type)
values
- the ValueSet to encode.fields
- the FieldInfos to encode.type
- indicates the file format.
public boolean writeToConnection(java.util.Vector<java.lang.String> lines)
writeToConnection
in class LyFileRequestEncoder
lines
- lines to write on the file.
public boolean writeToConnection(java.util.Vector<java.lang.Object> objects, java.util.Vector<LyField> fields, int type)
writeToConnection
in class LyFileRequestEncoder
objects
- the set of objects to encode.fields
- FieldInfos to save (if null save all).type
- indicates the file format.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |