Package com.caucho.config.attribute

Examples of com.caucho.config.attribute.Attribute


  public <T> void inject(T bean, CreationalContext<T> env)
  {
    try {
      ConfigType<?> type = TypeFactory.getType(bean.getClass());

      Attribute attr = type.getAttribute(_qName);

      if (attr != null)
        attr.setValue(bean, _qName, attr.getConfigType().valueOf(_value));
      else if (_qName.equals(InlineBeanType.TEXT) && "".equals(_value.trim())) {
        // server/3000
      }
      else if (! _isOptional)
        throw new ConfigException(L.l("'{0}' is an unknown property of '{1}'",
View Full Code Here


  public void setText(Object parent, QName name, String text)
    throws ConfigException
  {
    Object bean = create(parent, name);

    Attribute attr = _configType.getAttribute(VALUE);

    if (attr != null) {
      attr.setText(bean, VALUE, text);

      setValue(parent, name, bean);
    }
    else if (text == null || "".equals(text)) {
      // server/2pad
View Full Code Here

   */
  @Override
  public <T> void inject(T bean, CreationalContext<T> env)
  {
    try {
      Attribute attr = _attr;

      if (attr == null) {
        ConfigType<?> type = TypeFactory.getType(bean.getClass());

        attr = type.getAttribute(_qName);
      }

      if (attr != null)
        attr.setValue(bean, _qName, attr.getConfigType().valueOf(_value));
      else
        throw new ConfigException(L.l("'{0}' is an unknown attribute of '{1}'",
                                      _qName.getName(), bean.getClass().getName()));
    } catch (Exception e) {
      throw ConfigException.create(e);
View Full Code Here

  {
    if (qName.getName().startsWith("xmlns")) {
      return;
    }

    Attribute attrStrategy;

   try {
      attrStrategy = getAttribute(parentType, qName, childNode);
     
      if (attrStrategy == null) {
        if (qName.equals(TEXT)) {
          validateEmptyText(parentBean, childNode);
        }
      }
      else if (attrStrategy.isProgram()) {
        attrStrategy.setValue(parentBean, qName,
                              buildProgram(attrStrategy, childNode));
      }
      else if (attrStrategy.isNode()) {
        attrStrategy.setValue(parentBean, qName, childNode);
      }
      else if (configureInlineText(parentBean, childNode, qName, attrStrategy)) {
      }
      else if (configureInlineBean(parentBean, childNode, attrStrategy)) {
      }
View Full Code Here

  private Attribute getAttribute(ConfigType<?> type,
                                 QName qName,
                                 Node childNode)
  {
    Attribute attrStrategy;

    attrStrategy = type.getAttribute(qName);
   
    if (attrStrategy == null) {
      attrStrategy = type.getDefaultAttribute(qName);
View Full Code Here

TOP

Related Classes of com.caucho.config.attribute.Attribute

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.