Mass whitespace changes (Style Warnings)
[aaf/authz.git] / misc / rosetta / src / main / java / org / onap / aaf / misc / rosetta / JaxInfo.java
index edc5f78..d209f02 100644 (file)
@@ -65,22 +65,22 @@ public class JaxInfo {
     
 
     public int getType() {
-        if(isArray)return ARRAY;
-        else if(members!=null)return OBJECT;
+        if (isArray)return ARRAY;
+        else if (members!=null)return OBJECT;
         return DATA;
     }
     
     public JaxInfo getDerived(String derivedName) {
         JaxInfo derived;
         // Lazy Instantiation
-        if(extensions == null) {
+        if (extensions == null) {
             extensions = new HashMap<>();
             derived = null;
         } else {
             derived = extensions.get(derivedName);
         }
         
-        if(derived == null) {
+        if (derived == null) {
             //TODO for the moment, Classes are in same package
             Package pkg = clss.getPackage();
             try {
@@ -95,8 +95,8 @@ public class JaxInfo {
     }
 
     public static JaxInfo get(JaxInfo[] fields, String name) {
-        for(JaxInfo f : fields) {
-            if(name.equals(f.name)) return f;
+        for (JaxInfo f : fields) {
+            if (name.equals(f.name)) return f;
         }
         return null;
     }
@@ -128,7 +128,7 @@ public class JaxInfo {
      */
     public static JaxInfo build(Class<?> cls, String ... rootNns) throws SecurityException, NoSuchFieldException, ClassNotFoundException, ParseException {
         String defaultNS;
-        if(rootNns.length>0 && rootNns[0]!=null) {
+        if (rootNns.length>0 && rootNns[0]!=null) {
             defaultNS = rootNns[0];
         } else {
             Package pkg = cls.getPackage();
@@ -136,15 +136,15 @@ public class JaxInfo {
             defaultNS = xs==null?"":xs.namespace();
         }
         String name;
-        if(rootNns.length>1) {
+        if (rootNns.length>1) {
             name = rootNns[1];
         } else {
             XmlRootElement xre = cls.getAnnotation(XmlRootElement.class);
-            if(xre!=null) {
+            if (xre!=null) {
                 name = xre.name();
             } else {
                 XmlType xt = cls.getAnnotation(XmlType.class);
-                if(xt!=null) {
+                if (xt!=null) {
                     name=xt.name();
                 } else {
                     throw new ParseException("Need a JAXB Object with XmlRootElement, or stipulate in parms");
@@ -162,10 +162,10 @@ public class JaxInfo {
         Class<?> cls = clazz;
         // Build up Method names from JAXB Annotations
         XmlType xt;
-        while((xt = cls.getAnnotation(XmlType.class))!=null) {
-            if(fields==null)fields = new ArrayList<>();
-            for(String field : xt.propOrder()) {
-                if("".equals(field)) break; // odd bug.  "" returned when no fields exist, rather than empty array
+        while ((xt = cls.getAnnotation(XmlType.class))!=null) {
+            if (fields==null)fields = new ArrayList<>();
+            for (String field : xt.propOrder()) {
+                if ("".equals(field)) break; // odd bug.  "" returned when no fields exist, rather than empty array
                 Field rf = cls.getDeclaredField(field);
                 Class<?> ft = rf.getType();
                 
@@ -175,27 +175,27 @@ public class JaxInfo {
                 String namespace = defaultNS;
                 
                 XmlElement xe = rf.getAnnotation(XmlElement.class);
-                if(xe!=null) {
+                if (xe!=null) {
                     xmlName=xe.name();
                     required = xe.required();
                     nillable = false;
-                    if(DEFAULT.equals(xmlName)) {
+                    if (DEFAULT.equals(xmlName)) {
                         xmlName = field;
                     }
                     namespace = xe.namespace();
-                    if(DEFAULT.equals(namespace)) {
+                    if (DEFAULT.equals(namespace)) {
                         namespace = defaultNS;
                     }
                 }
                 // If object is a List, then it is possible multiple, per XML/JAXB evaluation
-                if(ft.isAssignableFrom(List.class)) {
+                if (ft.isAssignableFrom(List.class)) {
                     Type t = rf.getGenericType();
                     String classname = t.toString();
                     int start = classname.indexOf('<');
                     int end = classname.indexOf('>');
                     Class<?> genClass = Class.forName(classname.substring(start+1, end));
                     xe = genClass.getAnnotation(XmlElement.class);
-                    if(xe!=null && !DEFAULT.equals(xe.namespace())) {
+                    if (xe!=null && !DEFAULT.equals(xe.namespace())) {
                         namespace = xe.namespace();
                     }
                     // add recursed recursed member, marked as array
@@ -208,7 +208,7 @@ public class JaxInfo {
             }
             cls = cls.getSuperclass();
         };
-        if(fields!=null) {
+        if (fields!=null) {
             JaxInfo[] rv = new JaxInfo[fields.size()];
             fields.toArray(rv);
             return rv;
@@ -219,17 +219,17 @@ public class JaxInfo {
 
 
     public StringBuilder dump(StringBuilder sb, int idx) {
-        for(int i=0;i<idx;++i)sb.append(' ');
+        for (int i=0;i<idx;++i)sb.append(' ');
         sb.append("Field ");
         sb.append(name);
         sb.append(" [");
         sb.append(clss.getName());
         sb.append("] ");
-        if(isArray)sb.append(" (array)");
-        if(required)sb.append(" (required)");
-        if(nillable)sb.append(" (nillable)");
-        if(members!=null) {
-            for(JaxInfo f : members) {
+        if (isArray)sb.append(" (array)");
+        if (required)sb.append(" (required)");
+        if (nillable)sb.append(" (nillable)");
+        if (members!=null) {
+            for (JaxInfo f : members) {
                 sb.append('\n');
                 f.dump(sb,idx+2);
             }