LdapSyntax syntax = attributeType.getSyntax(); if ( syntax.isHumanReadable() ) if ( syntax.getOid().equals( SchemaConstants.INTEGER_SYNTAX ) ) else if ( syntax.getOid().equals( SchemaConstants.DIRECTORY_STRING_SYNTAX ) ) else if ( syntax.getOid().equals( SchemaConstants.TELEPHONE_NUMBER_SYNTAX ) )
/** * {@inheritDoc} */ @Override public LdapSyntax copy() { LdapSyntax copy = new LdapSyntax( oid ); // Copy the SchemaObject common data copy.copy( this ); // Copy the HR flag copy.isHumanReadable = isHumanReadable; // Copy the HR presence flag copy.hasHumanReadableFlag = hasHumanReadableFlag; // All the references to other Registries object are set to null. copy.syntaxChecker = null; return copy; }
/** * Remove the LdapSyntax from the Registries, updating the references to * other SchemaObject. * * If one of the referenced SchemaObject does not exist, * an exception is thrown. * * @param ldapSyntax The LdapSyntax to remove from the Registries * @param errorHandler Error handler * @param registries The Registries */ public static void removeFromRegistries( LdapSyntax ldapSyntax, SchemaErrorHandler errorHandler, Registries registries ) { if ( ( registries != null ) && ( ldapSyntax.getSyntaxChecker() != null ) ) { /** * Remove the Syntax references (using and usedBy) : * S -> SC */ registries.delReference( ldapSyntax, ldapSyntax.getSyntaxChecker() ); } } }
private void createSyntaxMaps( Schema schema ) { Collection<LdapSyntax> lsds = schema.getLdapSyntaxDescriptions(); for ( LdapSyntax lsd : lsds ) { syntaxOid2LsdMap.put( lsd.getOid(), lsd ); if ( lsd.getDescription() != null ) { syntaxDesc2LsdMap.put( lsd.getDescription(), lsd ); } } }
ldapSyntax.unlock(); syntaxChecker = registries.getSyntaxCheckerRegistry().lookup( ldapSyntax.getOid() ); syntaxChecker = OctetStringSyntaxChecker.builder().setOid( ldapSyntax.getOid() ).build(); ldapSyntax.setSyntaxChecker( syntaxChecker ); ldapSyntax.lock();
isHR = attributeType.getSyntax().isHumanReadable();
ldapSyntax.setSpecification( value.getValue() ); if ( !schemaManager.getSyntaxCheckerRegistry().contains( ldapSyntax.getOid() ) ) ldapSyntax.isHumanReadable();
/** * Update the associated Syntax, even if the SchemaObject is readOnly * * @param newSyntax The Syntax for this AttributeType */ public void updateSyntax( LdapSyntax newSyntax ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT, getName() ) ); } this.syntax = newSyntax; this.syntaxOid = newSyntax.getOid(); }
LdapSyntax ldapSyntax = new LdapSyntax( oid ); int elementsSeen = 0; ldapSyntax.setDescription( getQDString( reader, pos ) );
/** * Creates a Syntax object using a unique OID. * * @param oid the OID for this syntax * @param description the description for this syntax */ public LdapSyntax( String oid, String description ) { super( SchemaObjectType.LDAP_SYNTAX, oid ); this.description = description; this.hasHumanReadableFlag = false; computeHashCode(); }
if ( !ldapSyntax.equals( that.ldapSyntax ) )
/** * Parses a LDAP syntax description according to RFC 4512: * * <pre> * SyntaxDescription = LPAREN WSP * numericoid ; object identifier * [ SP "DESC" SP qdstring ] ; description * extensions WSP RPAREN ; extensions * </pre> * * @param ldapSyntaxDescription the LDAP syntax description to be parsed * @return the parsed LdapSyntax bean * @throws ParseException if there are any recognition errors (bad syntax) */ public LdapSyntax parse( String ldapSyntaxDescription ) throws ParseException { LdapSyntax ldapSyntax = fastParser.parseLdapSyntax( ldapSyntaxDescription ); ldapSyntax.setSpecification( ldapSyntaxDescription ); // Update the schemaName updateSchemaName( ldapSyntax ); return ldapSyntax; } }
LdapSyntax syntax = new LdapSyntax( oid );
isHR = attributeType.getSyntax().isHumanReadable();
ldapSyntax.unlock(); syntaxChecker = registries.getSyntaxCheckerRegistry().lookup( ldapSyntax.getOid() ); syntaxChecker = OctetStringSyntaxChecker.builder().setOid( ldapSyntax.getOid() ).build(); ldapSyntax.setSyntaxChecker( syntaxChecker ); ldapSyntax.lock();
/** * Sets the Syntax * * @param ldapSyntax The Syntax */ public void setSyntax( LdapSyntax ldapSyntax ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_13700_CANNOT_MODIFY_LOCKED_SCHEMA_OBJECT, getName() ) ); } this.ldapSyntax = ldapSyntax; this.ldapSyntaxOid = ldapSyntax.getOid(); }
LdapSyntax ldapSyntax = new LdapSyntax( oid ); int elementsSeen = 0; ldapSyntax.setDescription( getQDString( reader, pos ) );
/** * Create the syntax maps and array. * * @param schema the schema */ private void createSyntaxMapsAndArray( Schema schema ) { List<String> syntaxDescsAndOidsList = new ArrayList<String>(); Collection<LdapSyntax> lsds = schema.getLdapSyntaxDescriptions(); for ( LdapSyntax lsd : lsds ) { syntaxOid2LsdMap.put( lsd.getOid(), lsd ); syntaxDescsAndOidsList.add( lsd.getOid() ); if ( lsd.getDescription() != null ) { syntaxDesc2LsdMap.put( lsd.getDescription(), lsd ); } } Collections.sort( syntaxDescsAndOidsList ); syntaxDescsAndOids = syntaxDescsAndOidsList.toArray( new String[0] ); }
/** * Creates a Syntax object using a unique OID. * * @param oid the OID for this syntax * @param description the description for this syntax */ public LdapSyntax( String oid, String description ) { super( SchemaObjectType.LDAP_SYNTAX, oid ); this.description = description; this.hasHumanReadableFlag = false; computeHashCode(); }
if ( !ldapSyntax.equals( that.ldapSyntax ) )