org.ocltf.translation.library
Class Fragment

java.lang.Object
  extended byorg.ocltf.translation.library.Fragment

public class Fragment
extends java.lang.Object

A Translation "fragment" of a translation file. This fragment belongs to a Translation object.

Author:
Chad Brandon
See Also:
Translation

Constructor Summary
Fragment()
          It doesn't make any sense to instatiate this object explicitly.
 
Method Summary
 void addKind(java.lang.String name, java.lang.String body)
          Adds the specified kind having the specified name and body to the Fragment.
 java.lang.String getHandlerMethod()
          Returns the name of the handler method.
 java.lang.String getKind(java.lang.String name)
          Returns the body for the fragment kind with the specified name.
 java.util.Map getKinds()
          Returns the kinds contained within this translation fragment
 java.lang.String getName()
          Gets the name of this fragment
 Translation getTranslation()
          Gets the Translation to which this Fragment belongs.
 void setHandlerMethod(java.lang.String handlerMethod)
          Sets the name of the handler method.
 void setName(java.lang.String name)
          Sets the name of this fragment.
 void setTranslation(Translation translation)
          Sets the Translation to which this Fragment belongs.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Fragment

public Fragment()
It doesn't make any sense to instatiate this object explicitly. It intended to be instantiated as part of a Translation.

See Also:
Translation
Method Detail

getName

public java.lang.String getName()
Gets the name of this fragment

Returns:

setName

public void setName(java.lang.String name)
Sets the name of this fragment.

Parameters:
name -

getKinds

public java.util.Map getKinds()
Returns the kinds contained within this translation fragment

Returns:
Map the Kinds keyed by name.

getKind

public java.lang.String getKind(java.lang.String name)
Returns the body for the fragment kind with the specified name.

Parameters:
name - the name of the kind to get.
Returns:
FragmentKind

addKind

public void addKind(java.lang.String name,
                    java.lang.String body)
Adds the specified kind having the specified name and body to the Fragment.

Parameters:
name - the name of the kind of expression.
body - the body of the kind of expression.

getHandlerMethod

public java.lang.String getHandlerMethod()
Returns the name of the handler method.

Returns:
Returns the handlerMethod.

setHandlerMethod

public void setHandlerMethod(java.lang.String handlerMethod)
Sets the name of the handler method. This method is the method within the Translator that handles the processing of the fragment.

Parameters:
handlerMethod - The handlerMethod to set.
See Also:
Translator

getTranslation

public Translation getTranslation()
Gets the Translation to which this Fragment belongs.

Returns:
Translation

setTranslation

public void setTranslation(Translation translation)
Sets the Translation to which this Fragment belongs.

Parameters:
translation -

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.