Package edu.uiuc.ncsa.oa2.qdl.storage
Class StemConverter<V extends edu.uiuc.ncsa.security.core.Identifiable>
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.data.MapConverter<V>
-
- org.oa4mp.server.qdl.storage.StemConverter<V>
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.XMLConverter<V>
- Direct Known Subclasses:
AdminClientStemMC
,ApprovalStemMC
,ClientStemMC
,PermissionStemMC
,TransactionStemMC
,TXRStemMC
public abstract class StemConverter<V extends edu.uiuc.ncsa.security.core.Identifiable> extends edu.uiuc.ncsa.security.storage.data.MapConverter<V>
Created by Jeff Gaynor
on 12/20/20 at 7:06 AM
-
-
Constructor Summary
Constructors Constructor Description StemConverter(edu.uiuc.ncsa.security.storage.data.MapConverter<V> mapConverter)
StemConverter(edu.uiuc.ncsa.security.storage.data.SerializationKeys keys, edu.uiuc.ncsa.security.core.IdentifiableProvider<V> provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fromList(Collection c, edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Convert a list in java object to a stem entry, setting it correctly.V
fromMap(edu.uiuc.ncsa.qdl.variables.QDLStem stem, V v)
V
fromMap(edu.uiuc.ncsa.security.storage.data.ConversionMap<String,Object> map, V v)
V
fromMap(Map<String,Object> map, V v)
edu.uiuc.ncsa.security.storage.data.MapConverter
getParentMC()
Parent map converter is the converter for the base object, i.e..boolean
hasParentMapConverter()
protected boolean
isStringKeyOK(edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Checks that a string entry to the string exists and is not trivialprotected boolean
isTimeOk(edu.uiuc.ncsa.qdl.variables.QDLStem QDLStem, String key)
Checks if the time (as a long) is non-negative.protected void
setNonNullStemValue(edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key, Object value)
Convenience.protected Date
toDate(edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Convert a long in a stem entry to a date.protected List
toList(edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Get an attribute that is a stem list and convert it to a Java (generic) list
Used infromMap(QDLStem, Identifiable)
edu.uiuc.ncsa.qdl.variables.QDLStem
toMap(V v, edu.uiuc.ncsa.qdl.variables.QDLStem stem)
void
toMap(V value, Map<String,Object> data)
-
-
-
Method Detail
-
fromMap
public V fromMap(edu.uiuc.ncsa.security.storage.data.ConversionMap<String,Object> map, V v)
- Overrides:
fromMap
in classedu.uiuc.ncsa.security.storage.data.MapConverter<V extends edu.uiuc.ncsa.security.core.Identifiable>
-
getParentMC
public edu.uiuc.ncsa.security.storage.data.MapConverter getParentMC()
Parent map converter is the converter for the base object, i.e.. aConversionMap
to a stored object.- Returns:
-
hasParentMapConverter
public boolean hasParentMapConverter()
-
toMap
public edu.uiuc.ncsa.qdl.variables.QDLStem toMap(V v, edu.uiuc.ncsa.qdl.variables.QDLStem stem)
-
isStringKeyOK
protected boolean isStringKeyOK(edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Checks that a string entry to the string exists and is not trivial- Parameters:
stem
-key
-- Returns:
-
isTimeOk
protected boolean isTimeOk(edu.uiuc.ncsa.qdl.variables.QDLStem QDLStem, String key)
Checks if the time (as a long) is non-negative. If this is supposed to be a bona fide date, then it cannot be negative.- Parameters:
QDLStem
-key
-- Returns:
-
toDate
protected Date toDate(edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Convert a long in a stem entry to a date.
Used infromMap(QDLStem, Identifiable)
- Parameters:
stem
-key
-- Returns:
-
toList
protected List toList(edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Get an attribute that is a stem list and convert it to a Java (generic) list
Used infromMap(QDLStem, Identifiable)
- Parameters:
stem
-key
-- Returns:
-
fromList
protected void fromList(Collection c, edu.uiuc.ncsa.qdl.variables.QDLStem stem, String key)
Convert a list in java object to a stem entry, setting it correctly.
I.e. The result will be stem.key := c
Used intoMap(Identifiable, QDLStem)
- Parameters:
c
-stem
-key
-
-
-