Package nexj.core.meta.persistence.sql

Examples of nexj.core.meta.persistence.sql.SQLTemplateSubstReader


      final PropertyMap propertyMap, final PropertyMap referenceMap,
      Reader input, final boolean bTest)
      throws IOException
   {
      // multiple pass over input, with each pass interpreting next depth level for unknown keys
      Reader reader = new SQLTemplateSubstReader(input)
       {
         protected Object getValue(String sKey, String sDefault)
         {
            if (referenceMap.hasValue(sKey)) // valid key
            {
               Object value = propertyMap.findValue(sKey);

               if (value == null) // valid key without value
               {
                  propertyMap.setValue(sKey, sDefault);
               }
               else if (sDefault != null && !value.equals(sDefault)) // new different default
               {
                  s_logger.warn("Multiple defaults detected for key: " + sKey);
               }
            }
            else if (bTest || !sKey.equals("iftest")) // invalid key, possibly requiring reparsing
            {
               try
               {
                  setTemplateDefaults(propertyMap, referenceMap, new StringReader(sDefault), bTest);
               }
               catch (IOException e)
               {
                  ObjUtil.rethrow(e); // wrap the exception to pass it out of this function
               }
            }

            return null;
         }
      };

      try
      {
         while (reader.read() >= 0); // consume entire input
      }
      catch (RuntimeException e)
      {
         if (e.getCause() instanceof IOException)
         {
View Full Code Here

TOP

Related Classes of nexj.core.meta.persistence.sql.SQLTemplateSubstReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.