org.jgroups.util.Util.getAllDeclaredFieldsWithAnnotations()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中org.jgroups.util.Util.getAllDeclaredFieldsWithAnnotations()方法的一些代码示例,展示了Util.getAllDeclaredFieldsWithAnnotations()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getAllDeclaredFieldsWithAnnotations()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:getAllDeclaredFieldsWithAnnotations

Util.getAllDeclaredFieldsWithAnnotations介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

  1. public static Field[] getAllDeclaredFields(final Class clazz) {
  2. return getAllDeclaredFieldsWithAnnotations(clazz);
  3. }

代码示例来源:origin: wildfly/wildfly

  1. /**
  2. * Makes sure that all fields annotated with @LocalAddress is (1) an InetAddress and (2) a valid address on any
  3. * local network interface
  4. * @param protocols
  5. * @throws Exception
  6. */
  7. public static void ensureValidBindAddresses(List<Protocol> protocols) throws Exception {
  8. for(Protocol protocol : protocols) {
  9. String protocolName=protocol.getName();
  10. //traverse class hierarchy and find all annotated fields and add them to the list if annotated
  11. Field[] fields=Util.getAllDeclaredFieldsWithAnnotations(protocol.getClass(), LocalAddress.class);
  12. for(int i=0; i < fields.length; i++) {
  13. Object val=getValueFromProtocol(protocol, fields[i]);
  14. if(val == null)
  15. continue;
  16. if(!(val instanceof InetAddress))
  17. throw new Exception("field " + protocolName + "." + fields[i].getName() + " is not an InetAddress");
  18. Util.checkIfValidAddress((InetAddress)val, protocolName);
  19. }
  20. }
  21. }

代码示例来源:origin: wildfly/wildfly

  1. Field[] fields=Util.getAllDeclaredFieldsWithAnnotations(protocol.getClass(), Property.class);
  2. for(int j=0; j < fields.length; j++) {

代码示例来源:origin: wildfly/wildfly

  1. Field[] fields=Util.getAllDeclaredFieldsWithAnnotations(protocol.getClass(), Property.class);
  2. for(int j=0; j < fields.length; j++) {
  3. String propertyName=PropertyHelper.getPropertyName(fields[j], properties);

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. public static Field[] getAllDeclaredFields(final Class clazz) {
  2. return getAllDeclaredFieldsWithAnnotations(clazz);
  3. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. /**
  2. * Makes sure that all fields annotated with @LocalAddress is (1) an InetAddress and (2) a valid address on any
  3. * local network interface
  4. * @param protocols
  5. * @throws Exception
  6. */
  7. public static void ensureValidBindAddresses(List<Protocol> protocols) throws Exception {
  8. for(Protocol protocol : protocols) {
  9. String protocolName=protocol.getName();
  10. //traverse class hierarchy and find all annotated fields and add them to the list if annotated
  11. Field[] fields=Util.getAllDeclaredFieldsWithAnnotations(protocol.getClass(), LocalAddress.class);
  12. for(int i=0; i < fields.length; i++) {
  13. Object val=getValueFromProtocol(protocol, fields[i]);
  14. if(val == null)
  15. continue;
  16. if(!(val instanceof InetAddress))
  17. throw new Exception("field " + protocolName + "." + fields[i].getName() + " is not an InetAddress");
  18. Util.checkIfValidAddress((InetAddress)val, protocolName);
  19. }
  20. }
  21. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. Field[] fields=Util.getAllDeclaredFieldsWithAnnotations(protocol.getClass(), Property.class);
  2. for(int j=0; j < fields.length; j++) {

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. Field[] fields=Util.getAllDeclaredFieldsWithAnnotations(protocol.getClass(), Property.class);
  2. for(int j=0; j < fields.length; j++) {
  3. String propertyName=PropertyHelper.getPropertyName(fields[j], properties);

相关文章

Util类方法