/** * Sets the SchemaObject readOnly flag * * @param enabled The current SchemaObject ReadOnly status */ public void setReadOnly( boolean isReadOnly ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.isReadOnly = isReadOnly; }
/** * A special method used when renaming an SchemaObject: we may have to * change it's OID * @param oid The new OID */ public void setOid( String oid ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } this.oid = oid; }
/** * Sets the SchemaObject's description * * @param description The SchemaObject's description */ public void setDescription( String description ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.description = description; } }
/** * Sets the name of the schema this SchemaObject is associated with. * * @param schemaName the new schema name */ public void setSchemaName( String schemaName ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.schemaName = schemaName; } }
/** * Sets the SchemaObject's specification * * @param specification The SchemaObject's specification */ public void setSpecification( String specification ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.specification = specification; } }
/** * Sets the Obsolete flag. * * @param obsolete The Obsolete flag state */ public void setObsolete( boolean obsolete ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { this.isObsolete = obsolete; } }
/** * Add an extension with its values * @param key The extension key * @param values The associated values */ public void addExtension( String key, List<String> values ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly ) { extensions.put( key, values ); } }
/** * Add an extensions with their values. (Actually do a copy) * * @param key The extension key * @param values The associated values */ public void setExtensions( Map<String, List<String>> extensions ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( !isReadOnly && ( extensions != null ) ) { this.extensions = new HashMap<String, List<String>>(); for ( String key : extensions.keySet() ) { List<String> values = new ArrayList<String>(); for ( String value : extensions.get( key ) ) { values.add( value ); } this.extensions.put( key, values ); } } }
/** * Sets the list of names for this SchemaObject. The names are * lowercased and trimmed. * * @param names The list of names. */ public void setNames( String... names ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( names == null ) { return; } if ( !isReadOnly ) { for ( String name : names ) { if ( name != null ) { this.names.add( name ); } } } }
/** * Sets the list of names for this SchemaObject. The names are * lowercased and trimmed. * * @param names The list of names. Can be empty */ public void setNames( List<String> names ) { if ( locked ) { throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) ); } if ( names == null ) { return; } if ( !isReadOnly ) { this.names = new ArrayList<String>( names.size() ); for ( String name : names ) { if ( name != null ) { this.names.add( name ); } } } }
throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );