org.dspace.app.xmlui.wing.element
Class Metadata

java.lang.Object
  extended by org.dspace.app.xmlui.wing.element.AbstractWingElement
      extended by org.dspace.app.xmlui.wing.element.Container
          extended by org.dspace.app.xmlui.wing.element.TextContainer
              extended by org.dspace.app.xmlui.wing.element.Metadata
All Implemented Interfaces:
MetadataElement, WingElement

public class Metadata
extends TextContainer
implements MetadataElement

This is a class representing an individual metadata field in pseudo-dublin core format. The metadata elements carries generic metadata information in the form of an attribute-value pair.

Author:
Scott Phillips

Field Summary
static String A_ELEMENT
          The name of the element attribute
static String A_LANGUAGE
          The name of the language attribute
static String A_QUALIFIER
          The name of the qualifier attribute
static String E_METADATA
          The name of the metadata element
 
Fields inherited from class org.dspace.app.xmlui.wing.element.Container
contents
 
Fields inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
context
 
Fields inherited from interface org.dspace.app.xmlui.wing.element.MetadataElement
A_REPOSITORY_IDENTIFIER
 
Constructor Summary
protected Metadata(WingContext context, String element, String qualifier, String language, boolean allowMultiple)
          Construct a new metadata.
 
Method Summary
protected  boolean allowMultiple()
          If an metadata with the same element, qualifier, and language exist within the document should this metadata element be added into the document or should only one metadata be allowed.
protected  boolean equals(String element, String qualifier, String language)
          Determine if the given element, qualifier, and lang are equal to this metadata.
 void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler, NamespaceSupport namespaces)
          Translate into SAX events.
 
Methods inherited from class org.dspace.app.xmlui.wing.element.TextContainer
addContent, addContent, addContent
 
Methods inherited from class org.dspace.app.xmlui.wing.element.Container
dispose
 
Methods inherited from class org.dspace.app.xmlui.wing.element.AbstractWingElement
endElement, endElement, getWingContext, greater, lesser, require, require, requireFalse, requireTrue, restrict, sendCharacters, setWingContext, startElement, startElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

E_METADATA

public static final String E_METADATA
The name of the metadata element

See Also:
Constant Field Values

A_ELEMENT

public static final String A_ELEMENT
The name of the element attribute

See Also:
Constant Field Values

A_QUALIFIER

public static final String A_QUALIFIER
The name of the qualifier attribute

See Also:
Constant Field Values

A_LANGUAGE

public static final String A_LANGUAGE
The name of the language attribute

See Also:
Constant Field Values
Constructor Detail

Metadata

protected Metadata(WingContext context,
                   String element,
                   String qualifier,
                   String language,
                   boolean allowMultiple)
            throws WingException
Construct a new metadata.

Parameters:
element - (Required) The element of this metadata
qualifier - (May be null) The qualifier of this metadata
language - (May be null) The language of this metadata
allowMultiple - (Required) Are multiple metadata elements with the same element, qualifier, and language allowed?
Throws:
WingException
Method Detail

allowMultiple

protected boolean allowMultiple()
If an metadata with the same element, qualifier, and language exist within the document should this metadata element be added into the document or should only one metadata be allowed.


equals

protected boolean equals(String element,
                         String qualifier,
                         String language)
Determine if the given element, qualifier, and lang are equal to this metadata.

Parameters:
element - (Required) The element of this metadata
qualifier - (May be null) The qualifier of this metadata
language - (May be null) The language of this metadata
Returns:
True if the given parameters are equal to this metadata.

toSAX

public void toSAX(ContentHandler contentHandler,
                  LexicalHandler lexicalHandler,
                  NamespaceSupport namespaces)
           throws SAXException
Translate into SAX events.

Specified by:
toSAX in interface WingElement
Overrides:
toSAX in class Container
Parameters:
contentHandler - (Required) The registered contentHandler where SAX events should be routed too.
lexicalHandler - (Required) The registered lexicalHandler where lexical events (such as CDATA, DTD, etc) should be routed too.
namespaces - (Required) SAX Helper class to keep track of namespaces able to determine the correct prefix for a given namespace URI.
Throws:
SAXException


Copyright © 2012 DuraSpace. All Rights Reserved.