Class StemConverter<V extends edu.uiuc.ncsa.security.core.Identifiable>

    • Field Summary

      • Fields inherited from class edu.uiuc.ncsa.security.storage.data.MapConverter

        keys, provider
    • 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)  
    • Constructor Detail

      • StemConverter

        public StemConverter​(edu.uiuc.ncsa.security.storage.data.MapConverter<V> mapConverter)
      • StemConverter

        public StemConverter​(edu.uiuc.ncsa.security.storage.data.SerializationKeys keys,
                             edu.uiuc.ncsa.security.core.IdentifiableProvider<V> provider)
    • Method Detail

      • fromMap

        public V fromMap​(edu.uiuc.ncsa.security.storage.data.ConversionMap<String,​Object> map,
                         V v)
        Overrides:
        fromMap in class edu.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.. a ConversionMap to a stored object.
        Returns:
      • hasParentMapConverter

        public boolean hasParentMapConverter()
      • fromMap

        public V fromMap​(org.qdl_lang.variables.QDLStem stem,
                         V v)
      • toMap

        public org.qdl_lang.variables.QDLStem toMap​(V v,
                                                    org.qdl_lang.variables.QDLStem stem)
      • isStringKeyOK

        protected boolean isStringKeyOK​(org.qdl_lang.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​(org.qdl_lang.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:
      • fromMap

        public V fromMap​(Map<String,​Object> map,
                         V v)
        Specified by:
        fromMap in interface edu.uiuc.ncsa.security.core.XMLConverter<V extends edu.uiuc.ncsa.security.core.Identifiable>
        Overrides:
        fromMap in class edu.uiuc.ncsa.security.storage.data.MapConverter<V extends edu.uiuc.ncsa.security.core.Identifiable>
      • convertToStem

        public org.qdl_lang.variables.QDLStem convertToStem​(Map<String,​Object> map)
      • toMap

        public void toMap​(V value,
                          Map<String,​Object> data)
        Specified by:
        toMap in interface edu.uiuc.ncsa.security.core.XMLConverter<V extends edu.uiuc.ncsa.security.core.Identifiable>
        Overrides:
        toMap in class edu.uiuc.ncsa.security.storage.data.MapConverter<V extends edu.uiuc.ncsa.security.core.Identifiable>
      • toDate

        protected Date toDate​(org.qdl_lang.variables.QDLStem stem,
                              String key)
        Convert a long in a stem entry to a date.
        Used in fromMap(QDLStem, Identifiable)
        Parameters:
        stem -
        key -
        Returns:
      • toList

        protected List toList​(org.qdl_lang.variables.QDLStem stem,
                              String key)
        Get an attribute that is a stem list and convert it to a Java (generic) list
        Used in fromMap(QDLStem, Identifiable)
        Parameters:
        stem -
        key -
        Returns:
      • fromList

        protected void fromList​(Collection c,
                                org.qdl_lang.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 in toMap(Identifiable, QDLStem)
        Parameters:
        c -
        stem -
        key -
      • setNonNullStemValue

        protected void setNonNullStemValue​(org.qdl_lang.variables.QDLStem stem,
                                           String key,
                                           Object value)
        Convenience. If the value is not null, this will put it in the stem. This handles dates as well by converting them to longs.
        Parameters:
        stem -
        key -
        value -