Package com.caucho.config.types

Examples of com.caucho.config.types.AnnotationConfig


  @Override
  public void setText(Object bean, QName name, String value)
    throws ConfigException
  {
    try {
      AnnotationConfig ann = (AnnotationConfig) bean;

      ann.setAttribute(name.getLocalName(), _type.valueOf(value));
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
  }
View Full Code Here


  @Override
  public void setValue(Object bean, QName name, Object value)
    throws ConfigException
  {
    try {
      AnnotationConfig ann = (AnnotationConfig) bean;

      ann.setAttribute(name.getLocalName(), value);
      //_putMethod.invoke(bean, name.getLocalName(), value);
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
  }
View Full Code Here

    if (value instanceof Annotation) {
      customBean.addAnnotation((Annotation) value);
    }
    else {
      AnnotationConfig annConfig = (AnnotationConfig) value;
      customBean.addAnnotation(annConfig.replace());
    }
  }
View Full Code Here

      throw new ConfigException(L.l("'{0}.{1}' is an unknown class for element '{2}'",
            packageName, localName, qName));
    }

    if (Annotation.class.isAssignableFrom(cl)) {
      return new AnnotationConfig(cl);
    }
    else {
      CustomBeanConfig config = new CustomBeanConfig(qName, cl);

      // config.setScope("singleton");
View Full Code Here

  CustomBeanConfig config = (CustomBeanConfig) value;

  value = config.toObject();
      }
      else if (value instanceof AnnotationConfig) {
  AnnotationConfig config = (AnnotationConfig) value;

  value = config.replace();
      }

      if (_setMethod != null && value != null) {
  if (! _setMethod.getParameterTypes()[0].isAssignableFrom(value.getClass()))
    throw new ConfigException(L.l("'{0}.{1}' is not assignable from {2}",
View Full Code Here

      throw new ConfigException(L.l("'{0}.{1}' is an unknown class for element '{2}'",
                                    pkg, localName, qName));
    }

    if (Annotation.class.isAssignableFrom(cl)) {
      return new AnnotationConfig(cl);
    }
    else {
      CustomBeanConfig config = new CustomBeanConfig(qName, cl);

      // config.setScope("singleton");
View Full Code Here

      throw new ConfigException(L.l("'{0}.{1}' is an unknown class for element '{2}'",
                                    qName.getNamespaceURI(), qName.getLocalName(), qName));
    }

    if (Annotation.class.isAssignableFrom(cl)) {
      return new AnnotationConfig(cl);
    }
    else {
      XmlBeanConfig<?> config = new XmlBeanConfig(qName, cl, parent);
      config.setInlineBean(true);
View Full Code Here

        XmlBeanConfig<?> config = (XmlBeanConfig<?>) value;

        value = config.toObject();
      }
      else if (value instanceof AnnotationConfig) {
        AnnotationConfig config = (AnnotationConfig) value;

        value = config.replace();
      }

      if (_setMethod != null && value != null) {
        if (! _setMethod.getParameterTypes()[0].isAssignableFrom(value.getClass()))
          throw new ConfigException(L.l("'{0}.{1}' is not assignable from {2}",
View Full Code Here

   * Creates a new instance of the type.
   */
  @Override
  public Object create(Object parent, QName name)
  {
    return new AnnotationConfig(this, _annClass);
  }
View Full Code Here

  /**
   * Converts the string to a value of the type.
   */
  public Object valueOf(String text)
  {
    AnnotationConfig ann = new AnnotationConfig(this, _annClass);

    if (! "".equals(text)) {
      // ioc/04e2
      Attribute attr = getAttribute(TEXT);

      if (attr == null)
        throw new ConfigException(L.l("'{0}' does not support value",
                                      this));

      attr.setText(ann, TEXT, text);
    }

    // ioc/2183

    return ann.replace();
  }
View Full Code Here

TOP

Related Classes of com.caucho.config.types.AnnotationConfig

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.