X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=misc%2Frosetta%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fmisc%2Frosetta%2FJaxInfo.java;fp=misc%2Frosetta%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fmisc%2Frosetta%2FJaxInfo.java;h=b4d5782aa68ed8cbf37ba514c05634658e0de4d8;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=d209f02f0995c449de4163425fcb62386af62964;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java index d209f02f..b4d5782a 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -39,7 +39,7 @@ public class JaxInfo { public static final int DATA = 0; public static final int ARRAY = 1; public static final int OBJECT = 2; - + public final String name; public final Class clss; public Map extensions; // Classes, which might be found at runtime, that extend this class. Lazy Instantiation @@ -50,7 +50,7 @@ public class JaxInfo { public final boolean nillable; public String ns; public boolean isObject() {return members!=null;} - + private JaxInfo(String n, String ns, Class c, JaxInfo[] members, boolean string, boolean array, boolean required, boolean nillable) { name = n; this.ns = ns; @@ -62,14 +62,14 @@ public class JaxInfo { this.nillable = nillable; extensions = null; } - + public int getType() { if (isArray)return ARRAY; else if (members!=null)return OBJECT; return DATA; } - + public JaxInfo getDerived(String derivedName) { JaxInfo derived; // Lazy Instantiation @@ -79,7 +79,7 @@ public class JaxInfo { } else { derived = extensions.get(derivedName); } - + if (derived == null) { //TODO for the moment, Classes are in same package Package pkg = clss.getPackage(); @@ -103,7 +103,7 @@ public class JaxInfo { /** * Build up JAXB Information (recursively) - * + * * @param cls * @param rootNns * @return @@ -117,7 +117,7 @@ public class JaxInfo { } /** * Build up JAXB Information (recursively) - * + * * @param cls * @param rootNns * @return @@ -151,10 +151,10 @@ public class JaxInfo { } } } - + return new JaxInfo(name,defaultNS, cls,buildFields(cls,defaultNS),false,false,false,false); } - + // Build up the name and members of this particular class // This is recursive, if a member is a JAXB Object as well. private static JaxInfo[] buildFields(Class clazz, String defaultNS) throws SecurityException, NoSuchFieldException, ClassNotFoundException { @@ -168,12 +168,12 @@ public class JaxInfo { if ("".equals(field)) break; // odd bug. "" returned when no fields exist, rather than empty array Field rf = cls.getDeclaredField(field); Class ft = rf.getType(); - + boolean required = false; boolean nillable = false; String xmlName = field; String namespace = defaultNS; - + XmlElement xe = rf.getAnnotation(XmlElement.class); if (xe!=null) { xmlName=xe.name();