// Create the new AttributeType
AttributeType attributeType = new AttributeType( oid );
// Syntax
EntryAttribute mSyntax = entry.get( MetaSchemaConstants.M_SYNTAX_AT );
if ( ( mSyntax != null ) && ( mSyntax.get() != null ) )
{
mSyntax.setHR( true );
attributeType.setSyntaxOid( mSyntax.getString() );
}
// Syntax Length
EntryAttribute mSyntaxLength = entry.get( MetaSchemaConstants.M_LENGTH_AT );
if ( mSyntaxLength != null )
{
mSyntaxLength.setHR( true );
attributeType.setSyntaxLength( Integer.parseInt( mSyntaxLength.getString() ) );
}
// Equality
EntryAttribute mEquality = entry.get( MetaSchemaConstants.M_EQUALITY_AT );
if ( mEquality != null )
{
mEquality.setHR( true );
attributeType.setEqualityOid( mEquality.getString() );
}
// Ordering
EntryAttribute mOrdering = entry.get( MetaSchemaConstants.M_ORDERING_AT );
if ( mOrdering != null )
{
mOrdering.setHR( true );
attributeType.setOrderingOid( mOrdering.getString() );
}
// Substr
EntryAttribute mSubstr = entry.get( MetaSchemaConstants.M_SUBSTR_AT );
if ( mSubstr != null )
{
mSubstr.setHR( true );
attributeType.setSubstringOid( mSubstr.getString() );
}
EntryAttribute mSupAttributeType = entry.get( MetaSchemaConstants.M_SUP_ATTRIBUTE_TYPE_AT );
// Sup
if ( mSupAttributeType != null )
{
mSupAttributeType.setHR( true );
attributeType.setSuperiorOid( mSupAttributeType.getString() );
}
// isCollective
EntryAttribute mCollective = entry.get( MetaSchemaConstants.M_COLLECTIVE_AT );
if ( mCollective != null )
{
mCollective.setHR( true );
String val = mCollective.getString();
attributeType.setCollective( val.equalsIgnoreCase( "TRUE" ) );
}
// isSingleValued
EntryAttribute mSingleValued = entry.get( MetaSchemaConstants.M_SINGLE_VALUE_AT );
if ( mSingleValued != null )
{
mSingleValued.setHR( true );
String val = mSingleValued.getString();
attributeType.setSingleValued( val.equalsIgnoreCase( "TRUE" ) );
}
// isReadOnly
EntryAttribute mNoUserModification = entry.get( MetaSchemaConstants.M_NO_USER_MODIFICATION_AT );
if ( mNoUserModification != null )
{
mNoUserModification.setHR( true );
String val = mNoUserModification.getString();
attributeType.setUserModifiable( !val.equalsIgnoreCase( "TRUE" ) );
}
// Usage
EntryAttribute mUsage = entry.get( MetaSchemaConstants.M_USAGE_AT );
if ( mUsage != null )
{
mUsage.setHR( true );
attributeType.setUsage( UsageEnum.getUsage( mUsage.getString() ) );
}
// Common properties
setSchemaObjectProperties( attributeType, entry, schema );