public class MetadataField
extends java.lang.Object
MetadataValue,
MetadataSchema| Constructor and Description |
|---|
MetadataField()
Default constructor.
|
MetadataField(int schemaID,
int fieldID,
java.lang.String element,
java.lang.String qualifier,
java.lang.String scopeNote)
Full constructor for existing metadata field elements.
|
MetadataField(MetadataSchema schema)
Constructor creating a field within a schema.
|
MetadataField(MetadataSchema schema,
java.lang.String element,
java.lang.String qualifier,
java.lang.String scopeNote)
Full constructor for new metadata field elements.
|
MetadataField(TableRow row)
Constructor to load the object from the database.
|
| Modifier and Type | Method and Description |
|---|---|
void |
create(Context context)
Creates a new metadata field.
|
void |
delete(Context context)
Delete the metadata field.
|
boolean |
equals(java.lang.Object obj)
Return
true if other is the same MetadataField
as this object, false otherwise |
static MetadataField |
find(Context context,
int id)
Find the field corresponding to the given numeric ID.
|
static MetadataField[] |
findAll(Context context)
Retrieve all Dublin Core types from the registry
|
static MetadataField[] |
findAllInSchema(Context context,
int schemaID)
Return all metadata fields that are found in a given schema.
|
static MetadataField |
findByElement(Context context,
int schemaID,
java.lang.String element,
java.lang.String qualifier)
Retrieves the metadata field from the database.
|
static java.lang.String |
formKey(java.lang.String schema,
java.lang.String element,
java.lang.String qualifier)
Return the HTML FORM key for the given field.
|
java.lang.String |
getElement()
Get the element name.
|
int |
getFieldID()
Get the metadata field id.
|
java.lang.String |
getQualifier()
Get the qualifier.
|
int |
getSchemaID()
Get the schema record key.
|
java.lang.String |
getScopeNote()
Get the scope note.
|
int |
hashCode() |
void |
setElement(java.lang.String element)
Set the element name.
|
void |
setQualifier(java.lang.String qualifier)
Set the qualifier.
|
void |
setSchemaID(int schemaID)
Set the schema record key.
|
void |
setScopeNote(java.lang.String scopeNote)
Set the scope note.
|
void |
update(Context context)
Update the metadata field in the database.
|
public MetadataField()
public MetadataField(MetadataSchema schema)
schema - schema to which the field belongspublic MetadataField(MetadataSchema schema, java.lang.String element, java.lang.String qualifier, java.lang.String scopeNote)
schema - schema to which the field belongselement - element of the fieldqualifier - qualifier of the fieldscopeNote - scope note of the fieldpublic MetadataField(int schemaID,
int fieldID,
java.lang.String element,
java.lang.String qualifier,
java.lang.String scopeNote)
schemaID - schema to which the field belongsfieldID - database ID of field.element - element of the fieldqualifier - qualifier of the fieldscopeNote - scope note of the fieldpublic MetadataField(TableRow row)
row - database row from which to populate object.public java.lang.String getElement()
public void setElement(java.lang.String element)
element - new value for elementpublic int getFieldID()
public java.lang.String getQualifier()
public void setQualifier(java.lang.String qualifier)
qualifier - new value for qualifierpublic int getSchemaID()
public void setSchemaID(int schemaID)
schemaID - new value for keypublic java.lang.String getScopeNote()
public void setScopeNote(java.lang.String scopeNote)
scopeNote - new value for scope notepublic void create(Context context) throws java.io.IOException, AuthorizeException, java.sql.SQLException, NonUniqueMetadataException
context - DSpace context objectjava.io.IOExceptionAuthorizeExceptionjava.sql.SQLExceptionNonUniqueMetadataExceptionpublic static MetadataField findByElement(Context context, int schemaID, java.lang.String element, java.lang.String qualifier) throws java.sql.SQLException, AuthorizeException
context - dspace contextschemaID - schema by IDelement - element namequalifier - qualifier (may be ANY or null)java.sql.SQLExceptionAuthorizeExceptionpublic static MetadataField[] findAll(Context context) throws java.sql.SQLException
context - dspace contextjava.sql.SQLExceptionpublic static MetadataField[] findAllInSchema(Context context, int schemaID) throws java.sql.SQLException
context - dspace contextschemaID - schema by db IDjava.sql.SQLExceptionpublic void update(Context context) throws java.sql.SQLException, AuthorizeException, NonUniqueMetadataException, java.io.IOException
context - dspace contextjava.sql.SQLExceptionAuthorizeExceptionNonUniqueMetadataExceptionjava.io.IOExceptionpublic void delete(Context context) throws java.sql.SQLException, AuthorizeException
context - dspace contextjava.sql.SQLExceptionAuthorizeExceptionpublic static java.lang.String formKey(java.lang.String schema,
java.lang.String element,
java.lang.String qualifier)
schema - element - qualifier - public static MetadataField find(Context context, int id) throws java.sql.SQLException
context - context, in case we need to read it in from DBid - the metadata field IDjava.sql.SQLExceptionpublic boolean equals(java.lang.Object obj)
true if other is the same MetadataField
as this object, false otherwiseequals in class java.lang.Objectobj - object to compare totrue if object passed in represents the same
MetadataField as this objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2018 DuraSpace. All Rights Reserved.