Package com.caucho.config.attribute

Examples of com.caucho.config.attribute.Attribute


    addProp(propName, attr);
  }
 
  private void addProp(String propName, Attribute attr)
  {
    Attribute oldAttr = _attributeMap.get(propName);
   
    if (oldAttr == null) {
      _attributeMap.put(propName, attr);
    }
    else if (attr.equals(oldAttr)) {
    }
    else if (oldAttr.isConfigurable() && ! attr.isConfigurable()) {
    }
    else if (attr.isConfigurable() && ! oldAttr.isConfigurable()) {
      _attributeMap.put(propName, attr);
    }
    else if (attr.isAssignableFrom(oldAttr)) {
    }
    else if (oldAttr.isAssignableFrom(attr)) {
      _attributeMap.put(propName, attr);
    }
    else {
      log.fine(L.l("{0}: conflicting attribute for '{1}' between {2} and {3}",
                   this, propName, attr, oldAttr));   
View Full Code Here


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

    Attribute attrStrategy;

    try {
      attrStrategy = getAttribute(type, qName, childNode);

      if (attrStrategy == null) {
      }
      else if (attrStrategy.isProgram()) {
        attrStrategy.setValue(bean, qName,
                              buildProgram(attrStrategy, childNode));
      }
      else if (attrStrategy.isNode()) {
        attrStrategy.setValue(bean, qName, childNode);
      }
      else if (configureInlineText(bean, childNode, qName, attrStrategy)) {
      }
      else if (configureInlineBean(bean, 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

  /**
   * Returns the attribute with the given name.
   */
  public Attribute getAttribute(QName qName)
  {
    Attribute attr = _nsAttributeMap.get(qName);

    if (attr == null) {
      attr = getAttributeImpl(qName);

      if (attr != null)
View Full Code Here

    return attr;
  }

  protected Attribute getAttributeImpl(QName qName)
  {
    Attribute attr = _beanType.getAttribute(qName);

    if (attr != null) {
      return XmlBeanProgramAttribute.ATTRIBUTE;
    }

    String uri = qName.getNamespaceURI();

    if (uri == null)
      return null;
    else if (! uri.startsWith("urn:java:") && ! uri.equals(RESIN_NS))
      return null;

    Method method = null;
    if (uri.equals(_namespaceURI)
        && (method = findMethod(qName.getLocalName())) != null) {
      return new XmlBeanMethodAttribute(_beanClass, method);
    }

    Field field = null;
    if (uri.equals(_namespaceURI)
        && (field = findField(qName.getLocalName())) != null) {
      return new XmlBeanFieldAttribute(_beanClass, field);
    }

    /*
    if ("value".equals(qName.getLocalName())
        && (uri.equals("urn:java:ee") || (uri.equals(RESIN_NS)))) {
      // ioc/022k
      return CustomBeanValueArgAttribute.ATTRIBUTE;
    }
    */

    if ("new".equals(qName.getLocalName())) {
      return XmlBeanNewAttribute.ATTRIBUTE;
    }

    Attribute envAttr
      = TypeFactory.getFactory().getEnvironmentAttribute(qName);

    if (envAttr instanceof FlowAttribute) {
      //        || envAttr instanceof EnvironmentAttribute) {
      // ioc/04c1
View Full Code Here

  }

  @Override
  public Attribute getProgramAttribute()
  {
    Attribute attr = _beanType.getProgramAttribute();

    if (attr == null)
      return null;

    // server/1kl5
View Full Code Here

   * Returns an environment type.
   */
  public Attribute getListAttribute(QName name)
  {
    synchronized (_listAttrMap) {
      Attribute attr = _listAttrMap.get(name);

      if (attr != null)
        return attr;

      ConfigType<?> type = getEnvironmentType(name);
View Full Code Here

   * Returns an environment type.
   */
  public Attribute getSetAttribute(QName name)
  {
    synchronized (_setAttrMap) {
      Attribute attr = _setAttrMap.get(name);

      if (attr != null)
        return attr;

      ConfigType<?> type = getEnvironmentType(name);
View Full Code Here

  /**
   * Returns an environment type.
   */
  public Attribute getEnvironmentAttribute(QName name)
  {
    Attribute attr = _envAttrMap.get(name);

    if (attr != null)
      return attr;

    ConfigType<?> type = getEnvironmentType(name);
View Full Code Here

  {
    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.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.