copper-server-impl/src/main/java/com/pogeyan/cmis/impl/services/CmisRelationshipService.java
/**
	 * Adds the default value of property if defined.
	 */
Adds the default value of property if defined.
Adds the default value of property if defined .
@SuppressWarnings({ "unchecked", "unused" })
	private static boolean addPropertyDefault(PropertiesImpl props, PropertyDefinition<?> propDef) {
		if (props == null || props.getProperties() == null) {
			LOG.error("Unknown properties: {}", props);
			throw new IllegalArgumentException("Props must not be null!");
		}
		if (propDef == null) {
			return false;
		}
		LOG.info("Adding the default value of properties: {}", props);
		List<?> defaultValue = propDef.getDefaultValue();
		if (defaultValue != null && !defaultValue.isEmpty()) {
			switch (propDef.getPropertyType()) {
			case BOOLEAN:
				props.addProperty(new PropertyBooleanImpl(propDef.getId(), (List<Boolean>) defaultValue));
				break;
			case DATETIME:
				props.addProperty(
						new PropertyDateTimeImpl(propDef.getId(), (List<GregorianCalendar>) defaultValue));
				break;
			case DECIMAL:
				props.addProperty(new PropertyDecimalImpl(propDef.getId(), (List<BigDecimal>) defaultValue));
				break;
			case HTML:
				props.addProperty(new PropertyHtmlImpl(propDef.getId(), (List<String>) defaultValue));
				break;
			case ID:
				props.addProperty(new PropertyIdImpl(propDef.getId(), (List<String>) defaultValue));
				break;
			case INTEGER:
				props.addProperty(new PropertyIntegerImpl(propDef.getId(), (List<BigInteger>) defaultValue));
				break;
			case STRING:
				props.addProperty(new PropertyStringImpl(propDef.getId(), (List<String>) defaultValue));
				break;
			case URI:
				props.addProperty(new PropertyUriImpl(propDef.getId(), (List<String>) defaultValue));
				break;
			default:
				assert false;
			}
			return true;
		}
		return false;
	}
@ SuppressWarnings ( { "unchecked" , "unused" } ) private static boolean addPropertyDefault ( PropertiesImpl props , PropertyDefinition < ? > propDef ) { if ( props == null || props . getProperties ( ) == null ) { LOG . error ( "Unknown properties: {}" , props ) ; throw new IllegalArgumentException ( "Props must not be null!" ) ; } if ( propDef == null ) { return false ; } LOG . info ( "Adding the default value of properties: {}" , props ) ; List < ? > defaultValue = propDef . getDefaultValue ( ) ; if ( defaultValue != null && ! defaultValue . isEmpty ( ) ) { switch ( propDef . getPropertyType ( ) ) { case BOOLEAN : props . addProperty ( new PropertyBooleanImpl ( propDef . getId ( ) , ( List < Boolean > ) defaultValue ) ) ; break ; case DATETIME : props . addProperty ( new PropertyDateTimeImpl ( propDef . getId ( ) , ( List < GregorianCalendar > ) defaultValue ) ) ; break ; case DECIMAL : props . addProperty ( new PropertyDecimalImpl ( propDef . getId ( ) , ( List < BigDecimal > ) defaultValue ) ) ; break ; case HTML : props . addProperty ( new PropertyHtmlImpl ( propDef . getId ( ) , ( List < String > ) defaultValue ) ) ; break ; case ID : props . addProperty ( new PropertyIdImpl ( propDef . getId ( ) , ( List < String > ) defaultValue ) ) ; break ; case INTEGER : props . addProperty ( new PropertyIntegerImpl ( propDef . getId ( ) , ( List < BigInteger > ) defaultValue ) ) ; break ; case STRING : props . addProperty ( new PropertyStringImpl ( propDef . getId ( ) , ( List < String > ) defaultValue ) ) ; break ; case URI : props . addProperty ( new PropertyUriImpl ( propDef . getId ( ) , ( List < String > ) defaultValue ) ) ; break ; default : assert false ; } return true ; } return false ; }
Adds the default value of property if defined.
Adds the default value of property if defined .