Examples of MetaClass


Examples of groovy.lang.MetaClass

            return getJavaBeanFXReadOnlyProperty(instance, propertyName);
        }
    }
   
    static public ReadOnlyProperty getJavaBeanFXReadOnlyProperty(Object instance, String propertyName) throws NoSuchMethodException {
        MetaClass mc = InvokerHelper.getMetaClass(instance);
        MetaProperty metaProperty = mc.getMetaProperty(propertyName);
        if(metaProperty != null) {
            Class type = metaProperty.getType();
            if(type == Boolean.class || type == Boolean.TYPE) {
                ReadOnlyJavaBeanBooleanPropertyBuilder builder = ReadOnlyJavaBeanBooleanPropertyBuilder.create();
                builder.bean(instance);
View Full Code Here

Examples of groovy.lang.MetaClass

            return null;
        }

    }
    static public Property getJavaBeanFXWritableProperty(Object instance, String propertyName) throws NoSuchMethodException {
        MetaClass mc = InvokerHelper.getMetaClass(instance);
        //Object a = mc.getAttribute(instance, propertyName);
        MetaProperty metaProperty = mc.getMetaProperty(propertyName);
        if(metaProperty != null) {
            Class type = metaProperty.getType();
            if(type == Boolean.class || type == Boolean.TYPE) {
                JavaBeanBooleanPropertyBuilder builder = JavaBeanBooleanPropertyBuilder.create();
                builder.bean(instance);
View Full Code Here

Examples of nexj.core.meta.Metaclass

       *
       * @param classDoc The class to process
       */
      private void write(ClassDoc classDoc) throws IOException
      {
         Metaclass clazz;
         Tag[] tagArray;

         // Set up the current class
         clazz = new Metaclass(getAlias(classDoc.name()));
         tagArray = classDoc.tags(DESCRIPTION_TAG);

         // Class @description
         if (tagArray.length > 0)
         {
            clazz.setDescription(tagArray[0].text());

            if (tagArray.length != 1)
            {
               warning(classDoc, "Multiple description tags found for " + clazz.getName());
            }
         }

         if (classDoc.superclass() != null)
         {
            clazz.setBase(new Metaclass(getAlias(classDoc.superclass().name())));

            if (clazz.getName().equals(clazz.getBase().getName()))
            {
               error(classDoc, "Type aliases cause circular hierarchy");
               clazz.setBase(null);
            }
         }

         // Process the methods
         addMembers(clazz, classDoc);

         ClassDoc[] innerTypeArray = classDoc.innerClasses();

         for (int i = 0; i < innerTypeArray.length; i++)
         {
            addMembers(clazz, innerTypeArray[i]);
         }

         innerTypeArray = classDoc.interfaces();

         for (int i = 0; i < innerTypeArray.length; i++)
         {
            addMembers(clazz, innerTypeArray[i]);
         }

         // Export to file
         FileOutputStream fosStream = null;
         IndentingXMLWriter xmlWriter = null;

         try
         {
            fosStream = new FileOutputStream(new File(m_outputDir, clazz.getName() + ".meta"));
            xmlWriter = new IndentingXMLWriter(new OutputStreamWriter(new BufferedOutputStream(fosStream), XMLUtil.ENCODING));

            new XMLMetadataExporter(xmlWriter).exportMetaclass(clazz);
         }
         finally
View Full Code Here

Examples of org.adoptopenjdk.jitwatch.model.MetaClass

    catch (ClassNotFoundException cnfe)
    {     
      fail();
    }

    MetaClass metaClass = testModel.getPackageManager().getMetaClass(fqClassName);
   
    MemberSignatureParts msp = MemberSignatureParts.fromLogCompilationSignature("org.adoptopenjdk.jitwatch.demo.MakeHotSpotLog " + methodName + " ()V");
   
    IMetaMember testMember = metaClass.getMemberFromSignature(msp);

    CompileNode root = buildCompileNodeForXML(lines, testMember, testModel);
   
//    private void testCallChain3()
//    {
View Full Code Here

Examples of org.apache.ibatis.reflection.MetaClass

    private ParameterMapping buildParameterMapping(String content) {
      StringTokenizer parameterMappingParts = new StringTokenizer(content, ", ");
      String property = parameterMappingParts.nextToken();
      Class propertyType;
      MetaClass metaClass = MetaClass.forClass(parameterType);
      if (typeHandlerRegistry.hasTypeHandler(parameterType)) {
        propertyType = parameterType;
      } else if (metaClass.hasGetter(property)){
        propertyType = metaClass.getGetterType(property);
      } else {
        propertyType = Object.class;
      }
      ParameterMapping.Builder builder = new ParameterMapping.Builder(configuration, property, propertyType);
      while (parameterMappingParts.hasMoreTokens()) {
View Full Code Here

Examples of org.apache.ibatis.reflection.MetaClass

  }

  private Class resolveResultJavaType(Class resultType, String property, Class javaType) {
    if (javaType == null && property != null) {
      try {
        MetaClass metaResultType = MetaClass.forClass(resultType);
        javaType = metaResultType.getSetterType(property);
      } catch (Exception e) {
        //ignore, following null check statement will deal with the situation
      }
    }
    if (javaType == null) {
View Full Code Here

Examples of org.apache.ibatis.reflection.MetaClass

    return javaType;
  }

  private Class resolveParameterJavaType(Class resultType, String property, Class javaType) {
    if (javaType == null) {
      MetaClass metaResultType = MetaClass.forClass(resultType);
      javaType = metaResultType.getGetterType(property);
    }
    if (javaType == null) {
      throw new BuilderException("Could not determine javaType for result.  Specify property or javaType attribute.");
    }
    return javaType;
View Full Code Here

Examples of org.apache.ibatis.reflection.MetaClass

  private void settingsElement(XNode context) throws Exception {
    if (context != null) {
      Properties props = context.getChildrenAsProperties();
      // Check that all settings are known to the configuration class
      MetaClass metaConfig = MetaClass.forClass(Configuration.class);
      for (Object key : props.keySet()) {
        if (!metaConfig.hasSetter(String.valueOf(key))) {
          throw new BuilderException("The setting " + key + " is not known.  Make sure you spelled it correctly (case sensitive).");
        }
      }
      configuration.setAutoMappingBehavior(AutoMappingBehavior.valueOf(stringValueOf(props.getProperty("autoMappingBehavior"), "PARTIAL")));
      configuration.setCacheEnabled(booleanValueOf(props.getProperty("cacheEnabled"), true));
View Full Code Here

Examples of org.apache.ibatis.reflection.MetaClass

      }
    }
  }

  private void createRowKeyForUnmappedProperties(ResultMap resultMap, ResultSet rs, CacheKey cacheKey) throws SQLException {
    final MetaClass metaType = MetaClass.forClass(resultMap.getType());
    final List<String> mappedColumnNames = new ArrayList<String>();
    final List<String> unmappedColumnNames = new ArrayList<String>();
    loadMappedAndUnmappedColumnNames(rs, resultMap, mappedColumnNames, unmappedColumnNames);
    for (String column : unmappedColumnNames) {
      if (metaType.findProperty(column) != null) {
        String value = rs.getString(column);
        if (value != null) {
          cacheKey.update(column);
          cacheKey.update(value);
        }
View Full Code Here

Examples of org.apache.ibatis.reflection.MetaClass

  }

  private Class<?> resolveResultJavaType(Class<?> resultType, String property, Class<?> javaType) {
    if (javaType == null && property != null) {
      try {
        MetaClass metaResultType = MetaClass.forClass(resultType);
        javaType = metaResultType.getSetterType(property);
      } catch (Exception e) {
        //ignore, following null check statement will deal with the situation
      }
    }
    if (javaType == null) {
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.