Examples of PutMethodMetaData


Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

            }
            term.setMapEntryMetaData(mapEntryMetaData);
            skip = Boolean.FALSE;
         }

         PutMethodMetaData putMethodMetaData = appInfo.getPutMethodMetaData();
         if(putMethodMetaData != null)
         {
            if (trace)
            {
               String msg = term.isWildcard() || term.isModelGroup() ? term.toString() : "element: name=" +
                  ((ElementBinding)term).getQName() + ",";

               msg += " putMethod=" +
                  putMethodMetaData.getName() +
                  ", keyType=" +
                  putMethodMetaData.getKeyType() +
                  ", valueType=" + putMethodMetaData.getValueType();
               log.trace(msg);
            }
            term.setPutMethodMetaData(putMethodMetaData);
         }
View Full Code Here

Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

      }
   }

   private void invokePut(QName qName, TermBinding term, Object owner, Object o)
   {
      PutMethodMetaData putMethodMetaData = term.getPutMethodMetaData();

      MapEntryMetaData mapEntryMetaData = term.getMapEntryMetaData();
      if(mapEntryMetaData == null)
      {
         throw new JBossXBRuntimeException((putMethodMetaData == null ?
            "Parent object is an instance of java.util.Map" :
            "putMethod is specified for element " + qName
            ) +
            " but mapEntry is specified for neither element " +
            qName +
            " nor it's type."
         );
      }

      Class oClass = o.getClass();
      String getKeyMethodName = mapEntryMetaData.getGetKeyMethod();
      if(getKeyMethodName == null)
      {
         getKeyMethodName = "getKey";
      }

      Method keyMethod;
      try
      {
         keyMethod = oClass.getMethod(getKeyMethodName, null);
      }
      catch(NoSuchMethodException e)
      {
         throw new JBossXBRuntimeException("setParent failed for " +
            qName +
            "=" +
            o +
            ": getKeyMethod=" +
            getKeyMethodName +
            " not found in " + oClass
         );
      }

      Object key;
      try
      {
         key = keyMethod.invoke(o, null);
      }
      catch(Exception e)
      {
         throw new JBossXBRuntimeException("setParent failed for " +
            qName +
            "=" +
            o +
            ": getKeyMethod=" +
            getKeyMethodName +
            " threw an exception: " + e.getMessage(), e
         );
      }

      Class keyType = Object.class;
      Class valueType = Object.class;
      String putMethodName = "put";
      Class ownerClass = owner.getClass();

      if(putMethodMetaData != null)
      {
         if(putMethodMetaData.getKeyType() != null)
         {
            try
            {
               keyType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getKeyType());
            }
            catch(ClassNotFoundException e)
            {
               throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
            }
         }

         if(putMethodMetaData.getValueType() != null)
         {
            try
            {
               valueType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getValueType());
            }
            catch(ClassNotFoundException e)
            {
               throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
            }
         }

         String name = putMethodMetaData.getName();
         if(name != null)
         {
            putMethodName = name;
         }
      }
View Full Code Here

Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

/*      */         }
/* 1330 */         term.setMapEntryMetaData(mapEntryMetaData);
/* 1331 */         skip = Boolean.FALSE;
/*      */       }
/*      */
/* 1334 */       PutMethodMetaData putMethodMetaData = appInfo.getPutMethodMetaData();
/* 1335 */       if (putMethodMetaData != null)
/*      */       {
/* 1337 */         if (trace)
/*      */         {
/* 1339 */           String msg = "element: name=" + ((ElementBinding)term).getQName() + ",";
/*      */
/* 1342 */           msg = msg + " putMethod=" + putMethodMetaData.getName() + ", keyType=" + putMethodMetaData.getKeyType() + ", valueType=" + putMethodMetaData.getValueType();
/*      */
/* 1347 */           log.trace(msg);
/*      */         }
/* 1349 */         term.setPutMethodMetaData(putMethodMetaData);
/*      */       }
View Full Code Here

Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

/*      */     }
/*      */   }
/*      */
/*      */   private void invokePut(QName qName, TermBinding term, Object owner, Object o)
/*      */   {
/* 1127 */     PutMethodMetaData putMethodMetaData = term.getPutMethodMetaData();
/*      */
/* 1129 */     MapEntryMetaData mapEntryMetaData = term.getMapEntryMetaData();
/* 1130 */     if (mapEntryMetaData == null)
/*      */     {
/* 1132 */       throw new JBossXBRuntimeException((putMethodMetaData == null ? "Parent object is an instance of java.util.Map" : new StringBuilder().append("putMethod is specified for element ").append(qName).toString()) + " but mapEntry is specified for neither element " + qName + " nor it's type.");
/*      */     }
/*      */
/* 1142 */     Class oClass = o.getClass();
/* 1143 */     String getKeyMethodName = mapEntryMetaData.getGetKeyMethod();
/* 1144 */     if (getKeyMethodName == null)
/*      */     {
/* 1146 */       getKeyMethodName = "getKey";
/*      */     }
/*      */     Method keyMethod;
/*      */     try
/*      */     {
/* 1152 */       keyMethod = oClass.getMethod(getKeyMethodName, null);
/*      */     }
/*      */     catch (NoSuchMethodException e)
/*      */     {
/* 1156 */       throw new JBossXBRuntimeException("setParent failed for " + qName + "=" + o + ": getKeyMethod=" + getKeyMethodName + " not found in " + oClass);
/*      */     }
/*      */
/*      */     Object key;
/*      */     try
/*      */     {
/* 1169 */       key = keyMethod.invoke(o, null);
/*      */     }
/*      */     catch (Exception e)
/*      */     {
/* 1173 */       throw new JBossXBRuntimeException("setParent failed for " + qName + "=" + o + ": getKeyMethod=" + getKeyMethodName + " threw an exception: " + e.getMessage(), e);
/*      */     }
/*      */
/* 1183 */     Class keyType = Object.class;
/* 1184 */     Class valueType = Object.class;
/* 1185 */     String putMethodName = "put";
/* 1186 */     Class ownerClass = owner.getClass();
/*      */
/* 1188 */     if (putMethodMetaData != null)
/*      */     {
/* 1190 */       if (putMethodMetaData.getKeyType() != null)
/*      */       {
/*      */         try
/*      */         {
/* 1194 */           keyType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getKeyType());
/*      */         }
/*      */         catch (ClassNotFoundException e)
/*      */         {
/* 1198 */           throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
/*      */         }
/*      */       }
/*      */
/* 1202 */       if (putMethodMetaData.getValueType() != null)
/*      */       {
/*      */         try
/*      */         {
/* 1206 */           valueType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getValueType());
/*      */         }
/*      */         catch (ClassNotFoundException e)
/*      */         {
/* 1210 */           throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
/*      */         }
/*      */       }
/*      */
/* 1214 */       String name = putMethodMetaData.getName();
/* 1215 */       if (name != null)
/*      */       {
/* 1217 */         putMethodName = name;
/*      */       }
/*      */     }
View Full Code Here

Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

      }
   }

   private void invokePut(QName qName, TermBinding term, Object owner, Object o)
   {
      PutMethodMetaData putMethodMetaData = term.getPutMethodMetaData();

      MapEntryMetaData mapEntryMetaData = term.getMapEntryMetaData();
      if(mapEntryMetaData == null)
      {
         throw new JBossXBRuntimeException((putMethodMetaData == null ?
            "Parent object is an instance of java.util.Map" :
            "putMethod is specified for element " + qName
            ) +
            " but mapEntry is specified for neither element " +
            qName +
            " nor it's type."
         );
      }

      Class<?> oClass = o.getClass();
      String getKeyMethodName = mapEntryMetaData.getGetKeyMethod();
      if(getKeyMethodName == null)
      {
         getKeyMethodName = "getKey";
      }

      Method keyMethod;
      try
      {
         keyMethod = oClass.getMethod(getKeyMethodName, null);
      }
      catch(NoSuchMethodException e)
      {
         throw new JBossXBRuntimeException("setParent failed for " +
            qName +
            "=" +
            o +
            ": getKeyMethod=" +
            getKeyMethodName +
            " not found in " + oClass
         );
      }

      Object key;
      try
      {
         key = keyMethod.invoke(o, null);
      }
      catch(Exception e)
      {
         throw new JBossXBRuntimeException("setParent failed for " +
            qName +
            "=" +
            o +
            ": getKeyMethod=" +
            getKeyMethodName +
            " threw an exception: " + e.getMessage(), e
         );
      }

      Class<?> keyType = Object.class;
      Class<?> valueType = Object.class;
      String putMethodName = "put";
      Class<?> ownerClass = owner.getClass();

      if(putMethodMetaData != null)
      {
         if(putMethodMetaData.getKeyType() != null)
         {
            try
            {
               keyType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getKeyType());
            }
            catch(ClassNotFoundException e)
            {
               throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
            }
         }

         if(putMethodMetaData.getValueType() != null)
         {
            try
            {
               valueType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getValueType());
            }
            catch(ClassNotFoundException e)
            {
               throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
            }
         }

         String name = putMethodMetaData.getName();
         if(name != null)
         {
            putMethodName = name;
         }
      }
View Full Code Here

Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

            }
            term.setMapEntryMetaData(mapEntryMetaData);
            skip = Boolean.FALSE;
         }

         PutMethodMetaData putMethodMetaData = appInfo.getPutMethodMetaData();
         if(putMethodMetaData != null)
         {
            if (trace)
            {
               String msg = term.isWildcard() || term.isModelGroup() ? term.toString() : "element: name=" +
                  ((ElementBinding)term).getQName() + ",";

               msg += " putMethod=" +
                  putMethodMetaData.getName() +
                  ", keyType=" +
                  putMethodMetaData.getKeyType() +
                  ", valueType=" + putMethodMetaData.getValueType();
               log.trace(msg);
            }
            term.setPutMethodMetaData(putMethodMetaData);
         }
View Full Code Here

Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

            }
            term.setMapEntryMetaData(mapEntryMetaData);
            skip = Boolean.FALSE;
         }

         PutMethodMetaData putMethodMetaData = appInfo.getPutMethodMetaData();
         if(putMethodMetaData != null)
         {
            if (trace)
            {
               String msg = term.isWildcard() || term.isModelGroup() ? term.toString() : "element: name=" +
                  ((ElementBinding)term).getQName() + ",";

               msg += " putMethod=" +
                  putMethodMetaData.getName() +
                  ", keyType=" +
                  putMethodMetaData.getKeyType() +
                  ", valueType=" + putMethodMetaData.getValueType();
               log.trace(msg);
            }
            term.setPutMethodMetaData(putMethodMetaData);
         }
View Full Code Here

Examples of org.jboss.xb.binding.metadata.PutMethodMetaData

      }
   }

   private void invokePut(QName qName, TermBinding term, Object owner, Object o)
   {
      PutMethodMetaData putMethodMetaData = term.getPutMethodMetaData();

      MapEntryMetaData mapEntryMetaData = term.getMapEntryMetaData();
      if(mapEntryMetaData == null)
      {
         throw new JBossXBRuntimeException((putMethodMetaData == null ?
            "Parent object is an instance of java.util.Map" :
            "putMethod is specified for element " + qName
            ) +
            " but mapEntry is specified for neither element " +
            qName +
            " nor it's type."
         );
      }

      Class oClass = o.getClass();
      String getKeyMethodName = mapEntryMetaData.getGetKeyMethod();
      if(getKeyMethodName == null)
      {
         getKeyMethodName = "getKey";
      }

      Method keyMethod;
      try
      {
         keyMethod = oClass.getMethod(getKeyMethodName, null);
      }
      catch(NoSuchMethodException e)
      {
         throw new JBossXBRuntimeException("setParent failed for " +
            qName +
            "=" +
            o +
            ": getKeyMethod=" +
            getKeyMethodName +
            " not found in " + oClass
         );
      }

      Object key;
      try
      {
         key = keyMethod.invoke(o, null);
      }
      catch(Exception e)
      {
         throw new JBossXBRuntimeException("setParent failed for " +
            qName +
            "=" +
            o +
            ": getKeyMethod=" +
            getKeyMethodName +
            " threw an exception: " + e.getMessage(), e
         );
      }

      Class keyType = Object.class;
      Class valueType = Object.class;
      String putMethodName = "put";
      Class ownerClass = owner.getClass();

      if(putMethodMetaData != null)
      {
         if(putMethodMetaData.getKeyType() != null)
         {
            try
            {
               keyType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getKeyType());
            }
            catch(ClassNotFoundException e)
            {
               throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
            }
         }

         if(putMethodMetaData.getValueType() != null)
         {
            try
            {
               valueType = Thread.currentThread().getContextClassLoader().loadClass(putMethodMetaData.getValueType());
            }
            catch(ClassNotFoundException e)
            {
               throw new JBossXBRuntimeException("setParent failed for " + qName + ": " + e.getMessage(), e);
            }
         }

         String name = putMethodMetaData.getName();
         if(name != null)
         {
            putMethodName = name;
         }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.