/** * Create a new attribute * * @param type The attribute's type */ public void addAttribute( String type ) throws LdapException { currentAttribute = new DefaultEntryAttribute( type ); getDecorated().getEntry().put( currentAttribute ); }
/** * @return the Names as Ldif lines * @throws org.apache.directory.shared.ldap.model.exception.LdapException If the conversion goes wrong */ private String nameToLdif() throws LdapException { if ( names.size() == 0 ) { return ""; } else { Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( "m-name" ); for ( String name : names ) { attribute.add( name ); } entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }
/** * @return The description as a ldif line * @throws org.apache.directory.shared.ldap.model.exception.LdapException If the conversion goes wrong */ private String descToLdif() throws LdapException { if ( Strings.isEmpty( description ) ) { return ""; } else { Entry entry = new DefaultEntry(); Attribute attribute = new DefaultAttribute( "m-description", description ); entry.put( attribute ); return LdifUtils.convertAttributesToLdif( entry ); } }
/** * Create a new attributeValue * * @param type The attribute's name (called 'type' in the grammar) */ public void addAttributeType( String type ) throws LdapException { // do not create a new attribute if we have seen this attributeType before if ( getDecorated().getEntry().get( type ) != null ) { currentAttribute = getDecorated().getEntry().get( type ); return; } // fix this to use AttributeImpl(type.getString().toLowerCase()) currentAttribute = new DefaultEntryAttribute( type ); getDecorated().getEntry().put( currentAttribute ); }