org.nakedobjects.metamodel.facets.object.parseable
Class ParseableFacetAbstract

java.lang.Object
  extended by org.nakedobjects.metamodel.facets.FacetAbstract
      extended by org.nakedobjects.metamodel.facets.object.parseable.ParseableFacetAbstract
All Implemented Interfaces:
Facet, MultipleValueFacet, ParseableFacet
Direct Known Subclasses:
ParseableFacetAnnotation, ParseableFacetFromConfiguration

public abstract class ParseableFacetAbstract
extends FacetAbstract
implements ParseableFacet


Constructor Summary
ParseableFacetAbstract(java.lang.String candidateParserName, java.lang.Class<?> candidateParserClass, FacetHolder holder, RuntimeContext runtimeContext)
           
 
Method Summary
 java.lang.Class<?> getParserClass()
          Guaranteed to implement the Parser class, thanks to generics in the applib.
 RuntimeContext getRuntimeContext()
           
 boolean isValid()
          Discover whether either of the candidate parser name or class is valid.
 java.lang.String parseableTitle(NakedObject existing)
          A title for the object that is valid but which may be easier to edit than the title provided by a TitleFacet.
 NakedObject parseTextEntry(NakedObject original, java.lang.String entryText)
          Parses a text entry made by a user and sets the domain object's value.
protected  java.lang.String toStringValues()
           
 
Methods inherited from class org.nakedobjects.metamodel.facets.FacetAbstract
alwaysReplace, facetType, getFacetHolder, getIdentified, getUnderlyingFacet, isDerived, isNoop, setFacetHolder, setUnderlyingFacet, toString, unwrapObject, unwrapString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.metamodel.facets.Facet
alwaysReplace, facetType, getFacetHolder, getUnderlyingFacet, isDerived, isNoop, setFacetHolder, setUnderlyingFacet
 

Constructor Detail

ParseableFacetAbstract

public ParseableFacetAbstract(java.lang.String candidateParserName,
                              java.lang.Class<?> candidateParserClass,
                              FacetHolder holder,
                              RuntimeContext runtimeContext)
Method Detail

isValid

public boolean isValid()
Discover whether either of the candidate parser name or class is valid.


getParserClass

public java.lang.Class<?> getParserClass()
Guaranteed to implement the Parser class, thanks to generics in the applib.


toStringValues

protected java.lang.String toStringValues()
Overrides:
toStringValues in class FacetAbstract

parseTextEntry

public NakedObject parseTextEntry(NakedObject original,
                                  java.lang.String entryText)
Description copied from interface: ParseableFacet
Parses a text entry made by a user and sets the domain object's value.

Equivalent to Parser#parseTextEntry(Object, String), though may be implemented through some other mechanism.

Specified by:
parseTextEntry in interface ParseableFacet

parseableTitle

public java.lang.String parseableTitle(NakedObject existing)
Description copied from interface: ParseableFacet
A title for the object that is valid but which may be easier to edit than the title provided by a TitleFacet.

The idea here is that the viewer can display a parseable title for an existing object when, for example, the user initially clicks in the field. So, a date might be rendered via a TitleFacet as May 2, 2007, but its parseable form might be 20070502.

Specified by:
parseableTitle in interface ParseableFacet

getRuntimeContext

public RuntimeContext getRuntimeContext()


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.