Package com.caucho.config.types

Examples of com.caucho.config.types.CustomBeanConfig


      else
  api = _configType.getType();

      Class cl = factory.getDriverClassByScheme(api, localName);

      return new CustomBeanConfig(qName, cl);
    }

    if (! uri.startsWith("urn:java:"))
      throw new IllegalStateException(L.l("'{0}' is an unexpected namespace, expected 'urn:java:...'", uri));

    String packageName = uri.substring("uri:java:".length());
    Class cl = TypeFactory.loadClass(packageName, localName);

    if (cl == null) {
      ConfigType type = TypeFactory.getFactory().getEnvironmentType(qName);

      if (type != null)
  return type.create(parent, qName);

      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");

      return config;
    }
View Full Code Here


    throws ConfigException
  {
    Object objValue = create(bean, name);

    if (objValue instanceof CustomBeanConfig) {
      CustomBeanConfig config = (CustomBeanConfig) objValue;

      if (! value.trim().equals("")) {
  config.addArg(new TextArgProgram(value));
      }

      config.init();
    }

    setValue(bean, name, objValue);
  }
View Full Code Here

  public void setValue(Object bean, QName name, Object value)
    throws ConfigException
  {
    try {
      if (value instanceof CustomBeanConfig) {
  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

   * Sets the value of the attribute
   */
  public void setValue(Object bean, QName name, Object value)
    throws ConfigException
  {
    CustomBeanConfig customBean = (CustomBeanConfig) bean;

    customBean.addArg((ConfigProgram) value);
  }
View Full Code Here

  @Override
  public void setText(Object bean, QName name, String text)
    throws ConfigException
  {
    try {
      CustomBeanConfig customBean = (CustomBeanConfig) bean;

      customBean.addArg(new TextArgProgram(text));
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
  }
View Full Code Here

   * Sets the value of the attribute
   */
  public void setValue(Object bean, QName name, Object value)
    throws ConfigException
  {
    CustomBeanConfig customBean = (CustomBeanConfig) bean;

    if (value instanceof ConfigProgramArray) {
      ConfigProgramArray args = (ConfigProgramArray) value;

      customBean.addArgs(args.getArgs());
    }
    else
      customBean.addArg(new PropertyValueProgram("value", value));
  }
View Full Code Here

  @Override
  public void setText(Object bean, QName name, String text)
    throws ConfigException
  {
    try {
      CustomBeanConfig customBean = (CustomBeanConfig) bean;

      customBean.addArg(new TextArgProgram(text));
    } catch (Exception e) {
      throw ConfigException.create(e);
    }
  }
View Full Code Here

      else
        api = _configType.getType();

      Class cl = factory.getDriverClassByScheme(api, localName);

      return new CustomBeanConfig(qName, cl);
    }

    if (! uri.startsWith("urn:java:"))
      throw new IllegalStateException(L.l("'{0}' is an unexpected namespace, expected 'urn:java:...'", uri));

    String pkg = uri.substring("uri:java:".length());

    Class cl = TypeFactory.loadClass(pkg, localName);

    if (cl == null) {
      ConfigType type = TypeFactory.getFactory().getEnvironmentType(qName);

      if (type != null)
        return type.create(parent, qName);

      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");

      return config;
    }
View Full Code Here

    throws ConfigException
  {
    Object beanChild = create(bean, name);

    if (beanChild instanceof CustomBeanConfig) {
      CustomBeanConfig config = (CustomBeanConfig) beanChild;

      if (! value.trim().equals("")) {
        config.addArg(new TextArgProgram(value));
      }

      config.init();
    }

    setValue(bean, name, beanChild);
  }
View Full Code Here

TOP

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

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.