Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.ConfigProperty$JAXB


            continue;
          }

          if (! containsConfigProperty(configProperties, name)) {
            if (type != null) {
              ConfigProperty configProperty = new ConfigProperty();
              configProperties.add(configProperty);

              Object value = null;
              try {
                value = propertyDescriptor.getReadMethod().invoke(o);
              } catch (Exception e) {
              }

              javax.resource.spi.ConfigProperty annotation = propertyDescriptor.getWriteMethod().getAnnotation(javax.resource.spi.ConfigProperty.class);
                            if (annotation == null) {
                                try {
                                    // if there's no annotation on the setter, we'll try and scrape one off the field itself (assuming the same name)
                                    annotation = clazz.getDeclaredField(name).getAnnotation(javax.resource.spi.ConfigProperty.class);
                                } catch (Exception ignored) {
                                    // no-op : getDeclaredField() throws exceptions and does not return null
                                }
                            }

              configProperty.setConfigPropertyName(name);
              configProperty.setConfigPropertyType(getConfigPropertyType(annotation, type));
              if (value != null) {
                configProperty.setConfigPropertyValue(value.toString());
              }

              if (annotation != null) {
                if (annotation.defaultValue() != null && annotation.defaultValue().length() > 0) {
                  configProperty.setConfigPropertyValue(annotation.defaultValue());
                }
                configProperty.setConfigPropertyConfidential(annotation.confidential());
                configProperty.setConfigPropertyIgnore(annotation.ignore());
                configProperty.setConfigPropertySupportsDynamicUpdates(annotation.supportsDynamicUpdates());
                configProperty.setDescriptions(stringsToTexts(annotation.description()));
              }
            }
          }
        }

        // add any annotated fields we haven't already picked up
        Field[] declaredFields = clazz.getDeclaredFields();
        for (Field field : declaredFields) {
          javax.resource.spi.ConfigProperty annotation = field.getAnnotation(javax.resource.spi.ConfigProperty.class);

          String name = field.getName();
          Object value = null;
          try {
            value = field.get(o);
          } catch (Exception e) {
          }

          if (! containsConfigProperty(configProperties, name)) {
            String type = getConfigPropertyType(annotation, field.getType());

            if (type != null) {
              ConfigProperty configProperty = new ConfigProperty();
              configProperties.add(configProperty);

              configProperty.setConfigPropertyName(name);
              configProperty.setConfigPropertyType(type);
              if (value != null) {
                configProperty.setConfigPropertyValue(value.toString());
              }

              if (annotation != null) {
                if (annotation.defaultValue() != null) {
                  configProperty.setConfigPropertyValue(annotation.defaultValue());
                }
                configProperty.setConfigPropertyConfidential(annotation.confidential());
                configProperty.setConfigPropertyIgnore(annotation.ignore());
                configProperty.setConfigPropertySupportsDynamicUpdates(annotation.supportsDynamicUpdates());
              }
            }
          }
        }
      } catch (Exception  e) {
View Full Code Here


* @version $Rev$ $Date$
*/
public class EjbJarXml {

    public static EjbJar unmarshal(final InputStream inputStream) throws Exception {
        return Sxc.unmarshalJavaee(new EjbJar$JAXB(), inputStream);
    }
View Full Code Here

    public static EjbJar unmarshal(final InputStream inputStream) throws Exception {
        return Sxc.unmarshalJavaee(new EjbJar$JAXB(), inputStream);
    }

    public static void marshal(final EjbJar ejbJar, final OutputStream outputStream) throws Exception {
        Sxc.marshal(new EjbJar$JAXB(), ejbJar, new StreamResult(outputStream));
    }
View Full Code Here

        ejbJarJAXBCreate.stop();

        final Event unmarshalEvent = Event.start("unmarshal");
        final Object value;

        final EjbJar$JAXB jaxbType = new EjbJar$JAXB();
        value = Sxc.unmarshalJavaee(resource, jaxbType);

        unmarshalEvent.stop();

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

        ejbJarJAXBCreate.stop();

        final Event unmarshalEvent = Event.start("unmarshal");
        final Object value;

        final EjbJar$JAXB jaxbType = new EjbJar$JAXB();
        value = Sxc.unmarshalJavaee(resource, jaxbType);

        unmarshalEvent.stop();

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

        ejbJarJAXBCreate.stop();

        final Event unmarshalEvent = Event.start("unmarshal");
        final Object value;

        final EjbJar$JAXB jaxbType = new EjbJar$JAXB();
        value = Sxc.unmarshalJavaee(resource, jaxbType);

        unmarshalEvent.stop();

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

        ejbJarJAXBCreate.stop();

        final Event unmarshalEvent = Event.start("unmarshal");
        final Object value;

        final EjbJar$JAXB jaxbType = new EjbJar$JAXB();
        value = Sxc.unmarshalJavaee(resource, jaxbType);

        unmarshalEvent.stop();

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

* @version $Rev$ $Date$
*/
public class EjbJarXml {

    public static EjbJar unmarshal(InputStream inputStream) throws Exception {
        return Sxc.unmarshalJavaee(new EjbJar$JAXB(), inputStream);
    }
View Full Code Here

    public static EjbJar unmarshal(InputStream inputStream) throws Exception {
        return Sxc.unmarshalJavaee(new EjbJar$JAXB(), inputStream);
    }

    public static void marshal(EjbJar ejbJar, OutputStream outputStream) throws Exception {
        Sxc.marshal(new EjbJar$JAXB(), ejbJar, new StreamResult(outputStream));
    }
View Full Code Here

* @version $Rev$ $Date$
*/
public class FacesConfigXml {

    public static FacesConfig unmarshal(final InputStream inputStream) throws Exception {
        return Sxc.unmarshalJavaee(new FacesConfig$JAXB(), inputStream);
    }
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.ConfigProperty$JAXB

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.