public class MetadataField extends Object
MetadataValue,
MetadataSchema| Constructor and Description |
|---|
MetadataField()
Default constructor.
|
MetadataField(int schemaID,
int fieldID,
String element,
String qualifier,
String scopeNote)
Full constructor for existing metadata field elements.
|
MetadataField(MetadataSchema schema)
Constructor creating a field within a schema.
|
MetadataField(MetadataSchema schema,
String element,
String qualifier,
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(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,
String element,
String qualifier)
Retrieves the metadata field from the database.
|
static String |
formKey(String schema,
String element,
String qualifier)
Return the HTML FORM key for the given field.
|
String |
getElement()
Get the element name.
|
int |
getFieldID()
Get the metadata field id.
|
String |
getQualifier()
Get the qualifier.
|
int |
getSchemaID()
Get the schema record key.
|
String |
getScopeNote()
Get the scope note.
|
int |
hashCode() |
void |
setElement(String element)
Set the element name.
|
void |
setQualifier(String qualifier)
Set the qualifier.
|
void |
setSchemaID(int schemaID)
Set the schema record key.
|
void |
setScopeNote(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, String element, String qualifier, 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,
String element,
String qualifier,
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 String getElement()
public void setElement(String element)
element - new value for elementpublic int getFieldID()
public String getQualifier()
public void setQualifier(String qualifier)
qualifier - new value for qualifierpublic int getSchemaID()
public void setSchemaID(int schemaID)
schemaID - new value for keypublic String getScopeNote()
public void setScopeNote(String scopeNote)
scopeNote - new value for scope notepublic void create(Context context) throws IOException, AuthorizeException, SQLException, NonUniqueMetadataException
context - DSpace context objectIOExceptionAuthorizeExceptionSQLExceptionNonUniqueMetadataExceptionpublic static MetadataField findByElement(Context context, int schemaID, String element, String qualifier) throws SQLException
context - dspace contextschemaID - schema by IDelement - element namequalifier - qualifier (may be ANY or null)SQLExceptionAuthorizeExceptionpublic static MetadataField[] findAll(Context context) throws SQLException
context - dspace contextSQLExceptionpublic static MetadataField[] findAllInSchema(Context context, int schemaID) throws SQLException
context - dspace contextschemaID - schema by db IDSQLExceptionpublic void update(Context context) throws SQLException, AuthorizeException, NonUniqueMetadataException, IOException
context - dspace contextSQLExceptionAuthorizeExceptionNonUniqueMetadataExceptionIOExceptionpublic void delete(Context context) throws SQLException, AuthorizeException
context - dspace contextSQLExceptionAuthorizeExceptionpublic static String formKey(String schema, String element, String qualifier)
schema - element - qualifier - public static MetadataField find(Context context, int id) throws SQLException
context - context, in case we need to read it in from DBid - the metadata field IDSQLExceptionpublic boolean equals(Object obj)
true if other is the same MetadataField
as this object, false otherwiseCopyright © 2014 DuraSpace. All Rights Reserved.