public class LdapNamePropertyType extends PropertyType<LdapName>
javax.naming.ldap.LdapName
. Constructor Example | Comments | ||
---|---|---|---|
Property<LdapName> A_PROPERTY = |
Default value is null . |
||
Property<LdapName> A_PROPERTY = |
Default value is new LdapName("cn=Mango,ou=Fruits,o=Food") . |
||
Property<LdapName> A_PROPERTY = |
",dc=example,dc=com" will be append the value before validation, default value is new LdapName("cn=Mango,dc=example,dc=com") . |
||
Type of value(s) | Examples | Result | Comments |
Valid | cn=Mango,ou=Fruits,o=Food | new LdapName("cn=Mango,ou=Fruits,o=Food") | Validate successfully. |
Valid | cn=WaterMelon,ou=Summer,ou=Fruits,o=Food,o=Resources | new LdapName("cn=WaterMelon,ou=Summer,ou=Fruits,o=Food,o=Resources") | |
Valid | «empty string» | new LdapName("") | |
Invalid | cow | null |
Validate will throw an exception. The resulting value is null . |
Invalid | «only spaces» | null |
|
Invalid | null |
defaultValue OR null |
Validate will throw an exception. Return default value if set, otherwise null . |
LdapName
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
TYPE
The type name string constant of LdapNamePropertyType
|
Constructor and Description |
---|
LdapNamePropertyType()
Returns LdapNamePropertyType where the default value is
null , baseDN is null and "allowEmptyString" is set to true The attribute "allowEmptyString" is set to true . |
LdapNamePropertyType(boolean allowEmptyString)
Returns LdapNamePropertyType where the default value is
null and baseDN is null . |
LdapNamePropertyType(LdapName defaultValue)
Returns LdapNamePropertyType with default value.
|
LdapNamePropertyType(String baseDN)
Returns LdapNamePropertyType with no default value, but with baseDN set.
|
LdapNamePropertyType(String baseDN,
boolean allowEmptyString)
Returns LdapNamePropertyType with no default value, but with baseDN set.
|
LdapNamePropertyType(String baseDN,
LdapName defaultValue)
Returns LdapNamePropertyType with default value, and with baseDN set..
|
LdapNamePropertyType(String baseDN,
LdapName defaultValue,
boolean allowEmptyString)
Returns LdapNamePropertyType with default value,with baseDN set.
|
Modifier and Type | Method and Description |
---|---|
String |
getBaseDN()
The string post appended the value before validation.
|
List<String> |
getRestrictions()
Gets a detailed description of the PropertyType with any constraints that might influence the validation.
|
boolean |
isAllowEmptyString()
Normally the class
LdapName will allow an empty string, fx. |
void |
setAllowEmptyString(boolean allowEmptyString)
Sets if an empty string is allowed as ldap name value.
|
void |
setBaseDN(String baseDN)
Sets the baseDN
|
LdapName |
validateValue(String propertyName,
String value)
Converts the string representation of to a typed value.
|
equals, getDefaultValue, getDefaultValueAsString, getDefaultValueDescription, getDescription, getDescription, getInitializationPriority, getIo, getLogger, getTypeName, hasDefaultValue, isDefaultValueValid, postGetValueProcessing, setDefaultValue, setInitializationPriority, setIo, setTypedValue, setTypeName, toString, toType, validate, validateConstraints, validateNullType
public static final String TYPE
public LdapNamePropertyType()
null
, baseDN is null
and "allowEmptyString" is set to true
true
.public LdapNamePropertyType(boolean allowEmptyString)
null
and baseDN is null
.allowEmptyString
- normally the class LdapName
will allow an empty string, fx. new LdapName("")
. Set this to false
and a exception will be thrown in validate if the value is empty.public LdapNamePropertyType(LdapName defaultValue)
true
and baseDN is null
.defaultValue
- default value returned if property value is undefined.public LdapNamePropertyType(String baseDN)
true
.baseDN
- this will append the value if it does not already ends with this value. This is done before validation
This is to avoid really long names and to ensure and specific node is used. It will not be used if the value is null
or an empty string after trim.public LdapNamePropertyType(String baseDN, LdapName defaultValue)
true
.baseDN
- this will append the value if it does not already ends with this value. This is done before validation
This is to avoid really long names and to ensure and specific node is used. It will not be used if the value is null
or an empty string after trim.defaultValue
- defaultValue default value returned if property value is undefined.public LdapNamePropertyType(String baseDN, boolean allowEmptyString)
baseDN
- this will append the value if it does not already ends with this value. This is done before validation
This is to avoid really long names and to ensure and specific node is used. It will not be used if the value is null
or an empty string after trim.allowEmptyString
- normally the class LdapName
will allow an empty string, fx. new LdapName("")
. Set this to false
and a exception will be thrown in validate if the value is empty.public LdapNamePropertyType(String baseDN, LdapName defaultValue, boolean allowEmptyString)
baseDN
- this will append the value if it does not already ends with this value. This is done before validation
This is to avoid really long names and to ensure and specific node is used. It will not be used if the value is null
or an empty string after trim.defaultValue
- defaultValue default value returned if property value is undefined.allowEmptyString
- normally the class LdapName
will allow an empty string, fx. new LdapName("")
. Set this to false
and a exception will be thrown in validate if the value is empty.public List<String> getRestrictions()
PropertyType
getRestrictions
in class PropertyType<LdapName>
public LdapName validateValue(String propertyName, String value) throws PropertyException
PropertyType
validateValue
in class PropertyType<LdapName>
propertyName
- the name of the property used for logging purposes. To uniquely identify the Property with validation issues.value
- the string representation of the propertyPropertyException
- if the conversion failed.public boolean isAllowEmptyString()
LdapName
will allow an empty string, fx. new LdapName("")
.
Set this to false
and a exception will be thrown in validate if the value is empty.true
if an emprty string is allowed, otherwise false
.public String getBaseDN()
public void setAllowEmptyString(boolean allowEmptyString)
allowEmptyString
- true
if it is allowed, otherwise false
.public void setBaseDN(String baseDN)
baseDN
- the baseDN