Construct.

@param clazz
the clazz
@param attribute
the attribute
346515
void construct(Class<X> clazz, Field attribute)
    {
        TypeBuilder<X> typeBuilder = new TypeBuilder<X>(attribute);
        typeBuilder.build((AbstractManagedType) managedTypes.get(clazz), attribute.getType());
    }
667489
protected void addProperties(Element element, BeanDefinitionBuilder builder) {
        NamedNodeMap attributes = element.getAttributes();
        
        for (int i = 0; i < attributes.getLength(); i++) {
            Node node = attributes.item(i);
            String attrName = getNodeName(node);
            attrName = "class".equals(attrName) ? "clazz" : attrName;
            builder.addPropertyValue(attrName, node.getNodeValue());
        }
    }
311284
public void setAttributes(final Map<String, Attribute> attributes) {
        this.internalAttributes = attributes;
        this.allAttributes.putAll(attributes);
    }
613864
public void addAttribute(String attribute, String value) {
		if (value == null) {
			value = "";
		}
		
		if (attribute.equals(FILL) ) {
			value = morphColor(value);
		}
		if (attribute.equals(STROKE_OPACITY)) {
			if (value.equals("0")) {
				props.setProperty(STROKE, "none");
			}
		}
		if (attribute.equals(STROKE_WIDTH)) {
			if (value.equals("")) {
				value = "1";
			}
			if (value.endsWith("px")) {
				value = value.substring(0,value.length()-2);
			}
		}
		if (attribute.equals(STROKE)) {
			if ("none".equals(props.getProperty(STROKE))) {
				return;
			}
			if ("".equals(props.getProperty(STROKE))) {
				return;
			}
			value = morphColor(value);
		}
		
		props.setProperty(attribute, value);
	}
304401
public void setAttribute(String key, Object attribute) {

		if (!isValid())
			throw new IllegalStateException(
					"Can not bind object to session that has been invalidated!!");

		if (key == null)
			throw new NullPointerException(
					"Name of attribute to bind cant be null!!!");
		if (attribute == null)
			throw new NullPointerException(
					"Attribute that is to be bound cant be null!!!");

		// Construct an event with the new value
		SipApplicationSessionBindingEvent event = null;

        // Call the valueBound() method if necessary
        if (attribute instanceof SipApplicationSessionBindingListener) {
            // Don't call any notification if replacing with the same value
            Object oldValue = getAttributeMap().get(key);
            if (attribute != oldValue) {
            	event = new SipApplicationSessionBindingEvent(this, key);
                try {
                    ((SipApplicationSessionBindingListener) attribute).valueBound(event);
                } catch (Throwable t){
                	logger.error("SipSessionBindingListener threw exception", t);
                }
            }
        }

		Object previousValue = this.getAttributeMap().put(key, attribute);

		if (previousValue != null && previousValue != attribute &&
	            previousValue instanceof SipApplicationSessionBindingListener) {
            try {
                ((SipApplicationSessionBindingListener) previousValue).valueUnbound
                    (new SipApplicationSessionBindingEvent(this, key));
            } catch (Throwable t) {
            	logger.error("SipSessionBindingListener threw exception", t);
            }
        }

		SipListeners listeners = sipContext.getListeners();
		List<SipApplicationSessionAttributeListener> listenersList = listeners.getSipApplicationSessionAttributeListeners();
		if(listenersList.size() > 0) {
			if(event == null) {
				event = new SipApplicationSessionBindingEvent(this, key);
			}
			if (previousValue == null) {
				for (SipApplicationSessionAttributeListener listener : listenersList) {
					if(logger.isDebugEnabled()) {
						logger.debug("notifying SipApplicationSessionAttributeListener " + listener.getClass().getCanonicalName() + " of attribute added on key "+ key);
					}
					try {
						listener.attributeAdded(event);
					} catch (Throwable t) {
						logger.error("SipApplicationSessionAttributeListener threw exception", t);
					}
				}
			} else {
				for (SipApplicationSessionAttributeListener listener : listenersList) {
					if(logger.isDebugEnabled()) {
						logger.debug("notifying SipApplicationSessionAttributeListener " + listener.getClass().getCanonicalName() + " of attribute replaced on key "+ key);
					}
					try {
						listener.attributeReplaced(event);
					} catch (Throwable t) {
						logger.error("SipApplicationSessionAttributeListener threw exception", t);
					}
				}
			}
		}
	}
1186783
public App withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
393861
@Override
    public void visit(final Attribute attribute) {
        if ("Time".equals(attribute.getString())) {
            timeString = attribute.getTail();
        }
    }
1217785
public <T> String create(Class<T> clazz) {
        return create(clazz, null, null);
    }
883587
private void storeAttribute(Attr attribute) {
        // examine the attributes in namespace xmlns
        if (attribute.getNamespaceURI() != null
                && attribute.getNamespaceURI().equals(
                        XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) {
            // Default namespace xmlns="uri goes here"
            if (attribute.getNodeName().equals(XMLConstants.XMLNS_ATTRIBUTE)) {
                putInCache(DEFAULT_NS, attribute.getNodeValue());
            } else {
                // Here are the defined prefixes stored
                putInCache(attribute.getLocalName(), attribute.getNodeValue());
            }
        }

    }
388339
private void onIdAttribute(final MetaModelBuilder builder, EntityMetadata entityMetadata, final Class clazz, Field f)
    {
        EntityType entity = (EntityType) builder.getManagedTypes().get(clazz);

        Attribute attrib = entity.getAttribute(f.getName());
        if (!attrib.isCollection() && ((SingularAttribute) attrib).isId())
        {
            entityMetadata.setIdAttribute((SingularAttribute) attrib);
            populateIdAccessorMethods(entityMetadata, clazz, f);
        }
    }
125871
public void insertAttributeAt(Attribute attribute, int i) {
        this.attributesInformation.insertAttributeAt(attribute,i) ;
        if (this.classIndex >= i) {
            this.classIndex++;
        }
    }
26119
public Javalin attribute(Class clazz, Object obj) {
        config.inner.appAttributes.put(clazz, obj);
        return this;
    }
778673
public void setAttribute(String name, Object attribute) {
        if (!_iSess.isValid())
            throw new IllegalStateException();
        if (null != attribute) {
            if (!(attribute instanceof HttpSessionBindingListener)) {
                _iSess.setAttribute(name, attribute, Boolean.FALSE);
            } else {
                _iSess.setAttribute(name, attribute, Boolean.TRUE);
            }
        } else {
            // attribute is null
            // if name is not null, remove it ... otherwise do nothing
            if (name != null) {
                _iSess.removeAttribute(name);
            }
        }
    }
1086192
public static void setValue(final String name, final Object attribute) {
		JKThreadLocal.get().put(name, attribute);
	}
857089
public void setAttribute(final String name, final Attribute attribute) {
        if (name.equals(MAP_KEY)) {
            this.mapAttribute = (MapAttribute) attribute;
        }
    }
349106
@Override
    public void validate(Class<?> clazz) {

        if (log.isDebugEnabled())
            log.debug("Validating " + clazz.getName());

        // Is Entity?
        if (!checkValidClass(clazz)) {

            throw new RuleValidationException(clazz.getName() + " is not a valid jpa entity.");
        }

        // must have a default no-argument constructor
        boolean flag = false;
        try {
            Constructor[] constructors = clazz.getDeclaredConstructors();
            for (Constructor constructor : constructors) {
                if ((Modifier.isPublic(constructor.getModifiers()) || Modifier.isProtected(constructor.getModifiers()))
                    && constructor.getParameterTypes().length == 0) {
                    flag = true;
                    break;
                }
            }
            if (!flag) {
                throw new Exception();
            }
        } catch (Exception e) {
            throw new RuleValidationException(clazz.getName()
                + " must have a default public or protected no-argument constructor.");
        }
    }
897262
public void insert(Attribute attribute) {
        queue.put(attribute.conceptId().getValue(), attribute);
        synchronized (this) {
            notifyAll();
        }
    }