/** * @see Object#equals() */ public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } return o instanceof Normalizer; }
buf.append( schemaObject.getOid() ); buf.append( '\n' ); if ( schemaObject.getDescription() != null ) buf.append( schemaObject.getDescription() ); buf.append( '\n' ); if ( schemaObject.getFqcn() != null ) buf.append( schemaObject.getFqcn() ); buf.append( '\n' ); if ( schemaObject.getBytecode() != null ) if ( schemaObject.getBytecode().length() > 16 ) buf.append( schemaObject.getBytecode().substring( 0, 16 ) ); buf.append( schemaObject.getBytecode() ); if ( schemaObject.getExtensions() != null ) getExtensions( buf, schemaObject.getExtensions() );
/** * Process the FQCN attribute */ private String getFqcn( LoadableSchemaObject description, String objectType ) { // The FQCN String mFqcn = description.getFqcn(); if ( mFqcn == null ) { String msg = I18n.err( I18n.ERR_10028, objectType, MetaSchemaConstants.M_FQCN_AT ); LOG.warn( msg ); throw new NullPointerException( msg ); } return mFqcn; }
/** * Process the ByteCode attribute */ private EntryAttribute getByteCode( LoadableSchemaObject description, String objectType ) { String byteCodeString = description.getBytecode(); if ( byteCodeString == null ) { String msg = I18n.err( I18n.ERR_10028, objectType, MetaSchemaConstants.M_BYTECODE_AT ); LOG.warn( msg ); throw new NullPointerException( msg ); } byte[] bytecode = Base64.decode( byteCodeString.toCharArray() ); EntryAttribute attr = new DefaultClientAttribute( MetaSchemaConstants.M_BYTECODE_AT, bytecode ); return attr; }
/** * Set the Fully Qualified Class Name for this SchemaObject instance * class stored in the bytecode attribute * @param fqcn The Fully Qualified Class Name */ public void setFqcn( String fqcn ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.fqcn = fqcn; } }
private SchemaObject copy( SchemaObject schemaObject ) { SchemaObject copy = null; if ( !( schemaObject instanceof LoadableSchemaObject ) ) { copy = schemaObject.copy(); } else { // Check the schemaObject here. if ( ( ( LoadableSchemaObject ) schemaObject ).isValid() ) { copy = schemaObject; } else { // We have an invalid SchemaObject, no need to go any further Throwable error = new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_11007, schemaObject.getOid() ) ); errors.add( error ); } } return copy; }
/** * Returns a String description of a schema. The resulting String format is : * <br> * (OID [DESC '<description>'] FQCN <fcqn> [BYTECODE <bytecode>] X-SCHEMA '<schema>') * <br> * @param description The description to transform to a String * @return */ public static String render( LoadableSchemaObject description ) { StringBuffer buf = new StringBuffer(); buf.append( "( " ).append( description.getOid() ); if ( description.getDescription() != null ) { buf.append( " DESC " ); renderQDString( buf, description.getDescription() ); } buf.append( " FQCN " ).append( description.getFqcn() ); if ( !StringTools.isEmpty( description.getBytecode() ) ) { buf.append( " BYTECODE " ).append( description.getBytecode() ); } buf.append( " X-SCHEMA '" ); buf.append( getSchemaName( description ) ); buf.append( "' )" ); return buf.toString(); }
/** * Stores some bytecode representing the compiled Java class for this * SchemaObject instance. * * @param bytecode The bytecode to store */ public void setBytecode( String bytecode ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.bytecode = bytecode; } }
/** * @see Object#equals() */ public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } return o instanceof LdapComparator<?>; }
/** * @see Object#equals() */ public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } return o instanceof SyntaxChecker; }