Package org.platformlayer.core.model

Examples of org.platformlayer.core.model.Generate


  }

  public void autoPopulate(Object item) throws OpsException {
    Class<? extends Object> itemClass = item.getClass();
    for (Field field : itemClass.getFields()) {
      Generate defaultAnnotation = field.getAnnotation(Generate.class);

      if (defaultAnnotation != null) {
        Class<?> fieldType = field.getType();

        Object value;
        try {
          value = field.get(item);
        } catch (IllegalAccessException e) {
          throw new IllegalStateException("Error getting field: " + field, e);
        }

        if (value == null) {
          String defaultValue = defaultAnnotation.value();
          if (!Strings.isNullOrEmpty(defaultValue)) {
            value = defaultValue;
          } else {
            if (fieldType == Secret.class) {
              Passwords passwords = new Passwords();
View Full Code Here

TOP

Related Classes of org.platformlayer.core.model.Generate

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.