Class MapModelAdaptor

  • All Implemented Interfaces:
    ModelAdaptor<java.util.Map<?,​?>>

    public class MapModelAdaptor
    extends java.lang.Object
    implements ModelAdaptor<java.util.Map<?,​?>>
    • Constructor Summary

      Constructors 
      Constructor Description
      MapModelAdaptor()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.Boolean containsKey​(java.util.Map<?,​?> map, java.lang.Object key)  
      private static java.lang.Object getDefaultValue​(java.util.Map<?,​?> map)  
      java.lang.Object getProperty​(Interpreter interp, ST self, java.util.Map<?,​?> model, java.lang.Object property, java.lang.String propertyName)
      Lookup property name in o and return its value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapModelAdaptor

        public MapModelAdaptor()
    • Method Detail

      • getProperty

        public java.lang.Object getProperty​(Interpreter interp,
                                            ST self,
                                            java.util.Map<?,​?> model,
                                            java.lang.Object property,
                                            java.lang.String propertyName)
                                     throws STNoSuchPropertyException
        Description copied from interface: ModelAdaptor
        Lookup property name in o and return its value.

        property is normally a String but doesn't have to be. E.g., if o is Map, property could be any key type. If we need to convert to String, then it's done by ST and passed in here.

        Specified by:
        getProperty in interface ModelAdaptor<java.util.Map<?,​?>>
        Throws:
        STNoSuchPropertyException
      • containsKey

        private static java.lang.Boolean containsKey​(java.util.Map<?,​?> map,
                                                     java.lang.Object key)
      • getDefaultValue

        private static java.lang.Object getDefaultValue​(java.util.Map<?,​?> map)