Codota Logo
MemberHoldingTypeDetails.getDeclaredMethods
Code IndexAdd Codota to your IDE (free)

How to use
getDeclaredMethods
method
in
org.springframework.roo.classpath.details.MemberHoldingTypeDetails

Best Java code snippets using org.springframework.roo.classpath.details.MemberHoldingTypeDetails.getDeclaredMethods (Showing top 19 results out of 315)

  • Common ways to obtain MemberHoldingTypeDetails
private void myMethod () {
MemberHoldingTypeDetails m =
  • Codota IconPhysicalTypeMetadata physicalTypeMetadata;physicalTypeMetadata.getMemberHoldingTypeDetails()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-roo

public List<MethodMetadata> getMethods() {
 final List<MethodMetadata> result = new ArrayList<MethodMetadata>();
 for (final MemberHoldingTypeDetails memberHoldingTypeDetails : details) {
  result.addAll(memberHoldingTypeDetails.getDeclaredMethods());
 }
 return result;
}
origin: spring-projects/spring-roo

public List<MethodMetadata> getMethods() {
 final List<MethodMetadata> result = new ArrayList<MethodMetadata>();
 MemberHoldingTypeDetails current = this;
 while (current != null) {
  for (final MethodMetadata method : current.getDeclaredMethods()) {
   result.add(method);
  }
  if (current instanceof ClassOrInterfaceTypeDetails) {
   current = ((ClassOrInterfaceTypeDetails) current).getSuperclass();
  } else {
   current = null;
  }
 }
 return result;
}
origin: spring-projects/spring-roo

/**
 * Locates all methods on the specified {@link MemberHoldingTypeDetails} based
 * on the method name.
 * 
 * @param memberHoldingTypeDetails the {@link MemberHoldingTypeDetails} to
 *            search; can be <code>null</code>
 * @param methodName to locate; can be <code>null</code>
 * @return the list of methods, or <code>null</code> if the given name was
 *         <code>null</code> or it was simply not found
 */
public static List<MethodMetadata> getDeclaredMethods(
  final MemberHoldingTypeDetails memberHoldingTypeDetails, final JavaSymbolName methodName) {
 if (memberHoldingTypeDetails == null) {
  return null;
 }
 List<MethodMetadata> methods = new ArrayList<MethodMetadata>();
 for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
  if (method.getMethodName().equals(methodName)) {
   methods.add(method);
  }
 }
 if (!methods.isEmpty()) {
  return methods;
 }
 return null;
}
origin: spring-projects/spring-roo

/**
 * Locates a method on the specified {@link MemberHoldingTypeDetails} based
 * on the method name.
 * 
 * @param memberHoldingTypeDetails the {@link MemberHoldingTypeDetails} to
 *            search; can be <code>null</code>
 * @param methodName to locate; can be <code>null</code>
 * @return the method, or <code>null</code> if the given name was
 *         <code>null</code> or it was simply not found
 */
public static MethodMetadata getDeclaredMethod(
  final MemberHoldingTypeDetails memberHoldingTypeDetails, final JavaSymbolName methodName) {
 if (memberHoldingTypeDetails == null) {
  return null;
 }
 for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
  if (method.getMethodName().equals(methodName)) {
   return method;
  }
 }
 return null;
}
origin: spring-projects/spring-roo

/**
 * Locates the specified method.
 * 
 * @param memberHoldingTypeDetails the {@link MemberHoldingTypeDetails} to
 *            search; can be <code>null</code>
 * @param methodName to locate; can be <code>null</code>
 * @param parameters to locate (can be null if there are no parameters)
 * @return the method, or <code>null</code> if the given name was
 *         <code>null</code> or it was simply not found
 */
public static MethodMetadata getDeclaredMethod(
  final MemberHoldingTypeDetails memberHoldingTypeDetails, final JavaSymbolName methodName,
  List<JavaType> parameters) {
 if (memberHoldingTypeDetails == null) {
  return null;
 }
 if (parameters == null) {
  parameters = new ArrayList<JavaType>();
 }
 for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
  if (method.getMethodName().equals(methodName)) {
   final List<JavaType> parameterTypes =
     AnnotatedJavaType.convertFromAnnotatedJavaTypes(method.getParameterTypes());
   if (parameterTypes.equals(parameters)) {
    return method;
   }
  }
 }
 return null;
}
origin: spring-projects/spring-roo

private void init(final MemberHoldingTypeDetails existing) {
 for (final ConstructorMetadata element : existing.getDeclaredConstructors()) {
  declaredConstructors.add(new ConstructorMetadataBuilder(element));
 }
 for (final FieldMetadata element : existing.getDeclaredFields()) {
  declaredFields.add(new FieldMetadataBuilder(element));
 }
 for (final MethodMetadata element : existing.getDeclaredMethods()) {
  declaredMethods.add(new MethodMetadataBuilder(element));
 }
 for (final ClassOrInterfaceTypeDetails element : existing.getDeclaredInnerTypes()) {
  declaredInnerTypes.add(new ClassOrInterfaceTypeDetailsBuilder(element));
 }
 for (final InitializerMetadata element : existing.getDeclaredInitializers()) {
  declaredInitializers.add(new InitializerMetadataBuilder(element));
 }
 extendsTypes.addAll(existing.getExtendsTypes());
 implementsTypes.addAll(existing.getImplementsTypes());
}
origin: spring-projects/spring-roo

 public List<MethodMetadata> matches(
   final List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList,
   final Map<String, String> pluralMap) {
  final List<FieldMetadata> fields = getFieldsInterestedIn(memberHoldingTypeDetailsList);
  final List<MethodMetadata> methods = new ArrayList<MethodMetadata>();
  final Set<JavaSymbolName> methodNames = new HashSet<JavaSymbolName>();
  final JavaSymbolName userDefinedMethodName =
    getUserDefinedMethod(memberHoldingTypeDetailsList, pluralMap);
  if (userDefinedMethodName == null) {
   for (final FieldMetadata field : fields) {
    methodNames.add(new JavaSymbolName(getPrefix()
      + StringUtils.capitalize(field.getFieldName().getSymbolName())));
   }
  } else {
   methodNames.add(new JavaSymbolName(userDefinedMethodName.getSymbolName() + additionalSuffix));
  }
  for (final MemberHoldingTypeDetails memberHoldingTypeDetails : memberHoldingTypeDetailsList) {
   for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
    if (methodNames.contains(method.getMethodName())) {
     methods.add(method);
    }
   }
  }
  return methods;
 }
}
origin: org.springframework.roo/org.springframework.roo.classpath

public List<MethodMetadata> getMethods() {
 final List<MethodMetadata> result = new ArrayList<MethodMetadata>();
 for (final MemberHoldingTypeDetails memberHoldingTypeDetails : details) {
  result.addAll(memberHoldingTypeDetails.getDeclaredMethods());
 }
 return result;
}
origin: org.gvnix/org.gvnix.service.roo.addon.addon

/**
 * {@inheritDoc}
 * <p>
 * Search all methods in class and related AJs.
 * </p>
 */
public List<MethodMetadata> getMethodsInAll(JavaType name) {
  List<MethodMetadata> methods = new ArrayList<MethodMetadata>();
  for (MemberHoldingTypeDetails member : getMemberDetails(name)) {
    methods.addAll(member.getDeclaredMethods());
  }
  return methods;
}
origin: org.springframework.roo/org.springframework.roo.classpath

public List<MethodMetadata> getMethods() {
 final List<MethodMetadata> result = new ArrayList<MethodMetadata>();
 MemberHoldingTypeDetails current = this;
 while (current != null) {
  for (final MethodMetadata method : current.getDeclaredMethods()) {
   result.add(method);
  }
  if (current instanceof ClassOrInterfaceTypeDetails) {
   current = ((ClassOrInterfaceTypeDetails) current).getSuperclass();
  } else {
   current = null;
  }
 }
 return result;
}
origin: org.springframework.roo/org.springframework.roo.classpath

/**
 * Locates all methods on the specified {@link MemberHoldingTypeDetails} based
 * on the method name.
 * 
 * @param memberHoldingTypeDetails the {@link MemberHoldingTypeDetails} to
 *            search; can be <code>null</code>
 * @param methodName to locate; can be <code>null</code>
 * @return the list of methods, or <code>null</code> if the given name was
 *         <code>null</code> or it was simply not found
 */
public static List<MethodMetadata> getDeclaredMethods(
  final MemberHoldingTypeDetails memberHoldingTypeDetails, final JavaSymbolName methodName) {
 if (memberHoldingTypeDetails == null) {
  return null;
 }
 List<MethodMetadata> methods = new ArrayList<MethodMetadata>();
 for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
  if (method.getMethodName().equals(methodName)) {
   methods.add(method);
  }
 }
 if (!methods.isEmpty()) {
  return methods;
 }
 return null;
}
origin: org.springframework.roo/org.springframework.roo.addon.beaninfo

/**
 * @return all public mutator methods defined by the class and all superclasses, sorted alphabetically (never null, but may be empty)
 */
public List<MethodMetadata> getPublicMutators() {
  // We keep these in a TreeMap so the methods are output in alphabetic order
  /** key: string based method name, value: MethodMetadata */
  TreeMap<String, MethodMetadata> map = new TreeMap<String, MethodMetadata>();
  for (MemberHoldingTypeDetails holder : memberHoldingTypeDetails) {
    for (MethodMetadata method : holder.getDeclaredMethods()) {
      String mutatorName = method.getMethodName().getSymbolName();
      if (Modifier.isPublic(method.getModifier()) && method.getParameterTypes().size() == 1 && mutatorName.startsWith("set")) {
        // We've got a public, single parameter, set method
        map.put(mutatorName, method);
      }
    }
  }
  return new ArrayList<MethodMetadata>(map.values());
}
origin: org.springframework.roo/org.springframework.roo.addon.beaninfo

/**
 * @param sortByAccessorName indicated to sort the returned accessors by getter name
 * @return all public accessor methods defined by the class and all superclasses (never null, but may be empty)
 */
public List<MethodMetadata> getPublicAccessors(boolean sortByAccessorName) {
  // We keep these in a TreeMap so the methods are output in alphabetic order
  /** key: string based method name, value: MethodMetadata */
  TreeMap<String, MethodMetadata> map = new TreeMap<String, MethodMetadata>();
  List<MethodMetadata> sortedByDetectionOrder = new ArrayList<MethodMetadata>();
  for (MemberHoldingTypeDetails holder : memberHoldingTypeDetails) {
    for (MethodMetadata method : holder.getDeclaredMethods()) {
      String accessorName = method.getMethodName().getSymbolName();
      if (Modifier.isPublic(method.getModifier()) && method.getParameterTypes().size() == 0 && (accessorName.startsWith("get") || accessorName.startsWith("is"))) {
        // We've got a public, no parameter, get|is method
        if (sortByAccessorName) {
          map.put(accessorName, method);
        } else {
          sortedByDetectionOrder.add(method);
        }
      }
    }
  }
  if (sortByAccessorName) {
    return new ArrayList<MethodMetadata>(map.values());
  }
  return sortedByDetectionOrder;
}
origin: org.gvnix/org.gvnix.service.roo.addon.addon

/**
 * {@inheritDoc}
 * <p>
 * Search the method by name in class and related AJs.
 * </p>
 */
public MethodMetadata getMethodByNameInAll(JavaType serviceClass,
    JavaSymbolName methodName) {
  MethodMetadata method = null;
  Iterator<MemberHoldingTypeDetails> members = getMemberDetails(
      serviceClass).iterator();
  while (method == null && members.hasNext()) {
    @SuppressWarnings("unchecked")
    List<MethodMetadata> methods = (List<MethodMetadata>) members
        .next().getDeclaredMethods();
    Iterator<MethodMetadata> methodsIter = methods.iterator();
    while (method == null && methodsIter.hasNext()) {
      MethodMetadata tmpMethod = methodsIter.next();
      if (tmpMethod.getMethodName().getSymbolName()
          .equals(methodName.getSymbolName())) {
        method = tmpMethod;
      }
    }
  }
  return method;
}
origin: org.springframework.roo/org.springframework.roo.classpath

/**
 * Locates a method on the specified {@link MemberHoldingTypeDetails} based
 * on the method name.
 * 
 * @param memberHoldingTypeDetails the {@link MemberHoldingTypeDetails} to
 *            search; can be <code>null</code>
 * @param methodName to locate; can be <code>null</code>
 * @return the method, or <code>null</code> if the given name was
 *         <code>null</code> or it was simply not found
 */
public static MethodMetadata getDeclaredMethod(
  final MemberHoldingTypeDetails memberHoldingTypeDetails, final JavaSymbolName methodName) {
 if (memberHoldingTypeDetails == null) {
  return null;
 }
 for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
  if (method.getMethodName().equals(methodName)) {
   return method;
  }
 }
 return null;
}
origin: org.springframework.roo/org.springframework.roo.classpath

/**
 * Locates the specified method.
 * 
 * @param memberHoldingTypeDetails the {@link MemberHoldingTypeDetails} to
 *            search; can be <code>null</code>
 * @param methodName to locate; can be <code>null</code>
 * @param parameters to locate (can be null if there are no parameters)
 * @return the method, or <code>null</code> if the given name was
 *         <code>null</code> or it was simply not found
 */
public static MethodMetadata getDeclaredMethod(
  final MemberHoldingTypeDetails memberHoldingTypeDetails, final JavaSymbolName methodName,
  List<JavaType> parameters) {
 if (memberHoldingTypeDetails == null) {
  return null;
 }
 if (parameters == null) {
  parameters = new ArrayList<JavaType>();
 }
 for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
  if (method.getMethodName().equals(methodName)) {
   final List<JavaType> parameterTypes =
     AnnotatedJavaType.convertFromAnnotatedJavaTypes(method.getParameterTypes());
   if (parameterTypes.equals(parameters)) {
    return method;
   }
  }
 }
 return null;
}
origin: org.springframework.roo/org.springframework.roo.classpath

private void init(final MemberHoldingTypeDetails existing) {
 for (final ConstructorMetadata element : existing.getDeclaredConstructors()) {
  declaredConstructors.add(new ConstructorMetadataBuilder(element));
 }
 for (final FieldMetadata element : existing.getDeclaredFields()) {
  declaredFields.add(new FieldMetadataBuilder(element));
 }
 for (final MethodMetadata element : existing.getDeclaredMethods()) {
  declaredMethods.add(new MethodMetadataBuilder(element));
 }
 for (final ClassOrInterfaceTypeDetails element : existing.getDeclaredInnerTypes()) {
  declaredInnerTypes.add(new ClassOrInterfaceTypeDetailsBuilder(element));
 }
 for (final InitializerMetadata element : existing.getDeclaredInitializers()) {
  declaredInitializers.add(new InitializerMetadataBuilder(element));
 }
 extendsTypes.addAll(existing.getExtendsTypes());
 implementsTypes.addAll(existing.getImplementsTypes());
}
origin: org.springframework.roo/org.springframework.roo.classpath

 public List<MethodMetadata> matches(
   final List<MemberHoldingTypeDetails> memberHoldingTypeDetailsList,
   final Map<String, String> pluralMap) {
  final List<FieldMetadata> fields = getFieldsInterestedIn(memberHoldingTypeDetailsList);
  final List<MethodMetadata> methods = new ArrayList<MethodMetadata>();
  final Set<JavaSymbolName> methodNames = new HashSet<JavaSymbolName>();
  final JavaSymbolName userDefinedMethodName =
    getUserDefinedMethod(memberHoldingTypeDetailsList, pluralMap);
  if (userDefinedMethodName == null) {
   for (final FieldMetadata field : fields) {
    methodNames.add(new JavaSymbolName(getPrefix()
      + StringUtils.capitalize(field.getFieldName().getSymbolName())));
   }
  } else {
   methodNames.add(new JavaSymbolName(userDefinedMethodName.getSymbolName() + additionalSuffix));
  }
  for (final MemberHoldingTypeDetails memberHoldingTypeDetails : memberHoldingTypeDetailsList) {
   for (final MethodMetadata method : memberHoldingTypeDetails.getDeclaredMethods()) {
    if (methodNames.contains(method.getMethodName())) {
     methods.add(method);
    }
   }
  }
  return methods;
 }
}
origin: org.gvnix/org.gvnix.occ.roo.addon.addon

  .getDetails()) {
for (MethodMetadata method : memberHoldingTypeDetails
    .getDeclaredMethods()) {
  if (BeanInfoUtils.isAccessorMethod(method)) {
org.springframework.roo.classpath.detailsMemberHoldingTypeDetailsgetDeclaredMethods

Popular methods of MemberHoldingTypeDetails

  • getLayerEntities
    If this is a layering component, for example a service or repository, returns the domain entities ma
  • getAnnotations
  • getDeclaredFields
  • getExtendsTypes
    Lists the classes this type extends. This may be empty. Always empty in the case of an enum. While a
  • getDeclaredByMetadataId
  • getDeclaredConstructors
  • getImplementsTypes
    Lists the classes this type implements. Always empty in the case of an interface. A List is used to
  • getImports
    Lists the imports this class includes. Also obtains imports from ITDs.
  • getMethods
    Locates all methods on this class and its superclasses.
  • getType
  • getAnnotation
  • getCustomData
  • getAnnotation,
  • getCustomData,
  • getDeclaredConstructor,
  • getDeclaredField,
  • getDeclaredInitializers,
  • getDeclaredInnerType,
  • getDeclaredInnerTypes,
  • getDynamicFinderNames,
  • getField

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • String (java.lang)
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JPanel (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now