org.springframework.core.Constants Java Examples

The following examples show how to use org.springframework.core.Constants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JcrNamespaceHandler.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected void postProcess(BeanDefinitionBuilder definitionBuilder, Element element) {
    List<Element> eventTypes = DomUtils.getChildElementsByTagName(element, EVENT_TYPE);
    if (eventTypes != null && eventTypes.size() > 0) {
        // compute event type
        int eventType = 0;
        Constants types = new Constants(Event.class);
        for (Iterator<Element> iter = eventTypes.iterator(); iter.hasNext();) {
            Element evenTypeElement = iter.next();
            eventType |= types.asNumber(DomUtils.getTextValue(evenTypeElement)).intValue();
        }
        definitionBuilder.addPropertyValue("eventTypes", Integer.valueOf(eventType));
    }

    List<Element> nodeTypeNames = DomUtils.getChildElementsByTagName(element, NODE_TYPE_NAME);
    String[] nodeTypeValues = new String[nodeTypeNames.size()];

    for (int i = 0; i < nodeTypeValues.length; i++) {
        nodeTypeValues[i] = DomUtils.getTextValue(nodeTypeNames.get(i));
    }
    definitionBuilder.addPropertyValue(NODE_TYPE_NAME, nodeTypeValues);
    List<Element> uuids = DomUtils.getChildElementsByTagName(element, UUID);

    String[] uuidsValues = new String[uuids.size()];

    for (int i = 0; i < uuidsValues.length; i++) {
        uuidsValues[i] = DomUtils.getTextValue(uuids.get(i));
    }

    definitionBuilder.addPropertyValue(UUID, uuidsValues);
    //TODO, reference a listenerBean, it is not a propertyReference
    Element eventListner = DomUtils.getChildElementByTagName(element, "listener");
    String listenerBeanRefName = DomUtils.getTextValue(eventListner);

    definitionBuilder.addPropertyReference("listener", listenerBeanRefName);
}
 
Example #2
Source File: TomcatJdbcDataSourceFactory.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
public void setDefaultTransactionIsolationName(String constantName) {
	if (constantName == null) {
		throw new IllegalArgumentException("Isolation name must not be null");
	}
	Constants constants = new Constants(Connection.class);
	setDefaultTransactionIsolation(
			constants.asNumber(PREFIX_ISOLATION + constantName).intValue());
}