Package com.caucho.config.attribute

Examples of com.caucho.config.attribute.Attribute


    String name = qName.getLocalName();

    if ("#text".equals(name))
      name = "value";

    Attribute attr = _attributeMap.get(name);

    return attr;
  }
View Full Code Here


    throw new UnsupportedOperationException(getClass().getName());
  }

  public Attribute getDefaultAttribute(QName qName)
  {
    Attribute attrStrategy = getProgramAttribute();

    if (attrStrategy != null)
      return attrStrategy;

    // ioc/2252 - flow attributes are not captured by ContentProgram

    attrStrategy = getContentProgramAttribute();

    TypeFactory factory = TypeFactory.getFactory();

    Attribute envStrategy = factory.getEnvironmentAttribute(qName);

    if (envStrategy instanceof FlowAttribute
        || envStrategy != null && attrStrategy == null)
      return envStrategy;
    else if (attrStrategy != null)
View Full Code Here

   */
  public boolean setProperty(Object bean,
                             QName name,
                             Object value)
  {
    Attribute attr = getAttribute(name);

    if (attr != null) {
      attr.setValue(bean, name, attr.getConfigType().valueOf(value));
     
      return true;
    }
    else
      return false;
View Full Code Here

   * Returns the attribute based on the given name.
   */
  @Override
  public Attribute getAttribute(QName name)
  {
    Attribute attr = _nsAttributeMap.get(name);

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

      if (attr != null)
View Full Code Here

  protected Attribute getAttributeImpl(QName name)
  {
    // server/2r10 vs jms/2193
    // attr = _attributeMap.get(name.getLocalName().toLowerCase(Locale.ENGLISH));

    Attribute attr = _attributeMap.get(name.getLocalName());

    if (attr != null)
      return attr;

    String uri = name.getNamespaceURI();
View Full Code Here

  public Attribute getAddAttribute(Class<?> cl)
  {
    if (cl == null)
      return null;

    Attribute attr = _addMethodMap.get(cl);

    if (attr != null) {
      return attr;
    }
   
View Full Code Here

      }
      else if (name.equals("add")
               && paramTypes.length == 1) {
        ConfigType<?> type = TypeFactory.getType(paramTypes[0]);

        Attribute addAttr = new AddAttribute(method, type);

        _addMethodMap.put(paramTypes[0], addAttr);

        // _addBean = addAttr;
      }
View Full Code Here

  }
 
  private void addProp(String propName,
                       Method method)
  {
    Attribute attr;
   
    Class<?> []paramTypes = method.getParameterTypes();
    Class<?> type = paramTypes[0];
   
    if (propName.equals("text")
View Full Code Here

    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

  public static void setAttribute(Object obj, String attr, Object value)
  {
    ConfigType<?> type = TypeFactory.getType(obj.getClass());

    QName attrName = new QName(attr);
    Attribute attrStrategy = type.getAttribute(attrName);
    if (attrStrategy == null)
      throw new ConfigException(L.l("{0}: '{1}' is an unknown attribute.",
                                    obj.getClass().getName(),
                                    attrName.getName()));

    value = attrStrategy.getConfigType().valueOf(value);

    attrStrategy.setValue(obj, attrName, value);
  }
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.