/** * @param name * @param value */ public void addMetadata(String name, Object value) { // check if name is one of registred metadataMap.setFast(false); try { metadataMap.put(name, value); } finally { metadataMap.setFast(true); } }
private synchronized void registerInstance() { if (isNew) { int max = 0; Iterator i = dsInstanceMap.keySet().iterator(); while (i.hasNext()) { int key = ((Integer) i.next()).intValue(); max = Math.max(max, key); } instanceKey = new Integer(max + 1); FastHashMap fhm = new FastHashMap(); fhm.setFast(true); dsInstanceMap.put(instanceKey, fhm); isNew = false; } }
/** @param value */ public void setMinLength(Long value) { metadataMap.put(PropertyMetadata.MIN_LENGTH, value); }
/** @param value */ public void setMaxSize(Long value) { metadataMap.put(PropertyMetadata.MAX_SIZE, value); }
/* * (non-Javadoc) * * @see nl.knowlogy.validation.metadata.PropertyMetadata#getMaxSize() */ public Long getMaxSize() { return (Long) metadataMap.get(PropertyMetadata.MAX_SIZE); }
public Long getMaxLength() { return (Long) metadataMap.get(PropertyMetadata.MAX_LENGTH); }
/* * (non-Javadoc) * * @see nl.knowlogy.validation.metadata.PropertyMetadata#isRequired() */ public Boolean isRequired() { Boolean value = (Boolean) metadataMap.get(PropertyMetadata.REQUIRED); return value != null ? value : Boolean.FALSE; }
/* * (non-Javadoc) * * @see nl.knowlogy.validation.metadata.PropertyMetadata#setRequired(boolean) */ public void setRequired(Boolean value) { metadataMap.put(PropertyMetadata.REQUIRED, value); }
/** @param value */ public void setAllowedValues(String value) { metadataMap.put(PropertyMetadata.ALLOWED_VALUES, value); }
public String getAllowedValues() { return (String) metadataMap.get(PropertyMetadata.ALLOWED_VALUES); }
/** @param pattern */ public void setPattern(String pattern) { metadataMap.put(PropertyMetadata.PATTERN, pattern); }
public String getPattern() { return (String) metadataMap.get(PropertyMetadata.PATTERN); }
/** @param value */ public void setMinSize(Long value) { metadataMap.put(PropertyMetadata.MIN_SIZE, value); }
/* * (non-Javadoc) * * @see nl.knowlogy.validation.metadata.PropertyMetadata#getMinSize() */ public Long getMinSize() { return (Long) metadataMap.get(PropertyMetadata.MIN_SIZE); }