Package org.appng.api.support
Class FieldProcessorImpl
- java.lang.Object
-
- org.appng.api.support.FieldProcessorImpl
-
- All Implemented Interfaces:
Serializable
,FieldProcessor
public final class FieldProcessorImpl extends Object implements FieldProcessor, Serializable
DefaultFieldProcessor
-implementation- Author:
- Matthias Müller
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FieldProcessorImpl(String reference)
FieldProcessorImpl(String reference, MetaData metaData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addErrorMessage(String message)
Adds aMessage
of typeMessageType.ERROR
.void
addErrorMessage(FieldDef field, String message)
Adds aMessage
of typeMessageType.ERROR
to the given field.void
addInvalidMessage(String message)
Adds aMessage
of typeMessageType.INVALID
.void
addInvalidMessage(FieldDef field, String message)
Adds aMessage
of typeMessageType.INVALID
to the given field.void
addLinkPanels(List<Linkpanel> panels)
Adds the given list ofLinkpanel
s to thisFieldProcessor
void
addNoticeMessage(String message)
Adds aMessage
of typeMessageType.INVALID
.void
addNoticeMessage(FieldDef field, String message)
Adds aMessage
of typeMessageType.NOTICE
to the given field.void
addOkMessage(String message)
Adds aMessage
of typeMessageType.OK
.void
addOkMessage(FieldDef field, String message)
Adds aMessage
of typeMessageType.OK
to the given field.void
clearFieldMessages()
Clears allMessage
s which were previously added usingaddXXMessage(FieldDef field, String message)
.void
clearFieldMessages(String... fieldBindings)
void
clearMessages()
Clears allMessage
s which were previously added usingaddXXMessage(String message)
.FieldDef
getField(String fieldBinding)
Returns theFieldDef
with the given binding, if existing.List<FieldDef>
getFields()
Returns allFieldDef
intions known by thisFieldProcessor
.Linkpanel
getLinkPanel(String fieldName)
Returns theLinkpanel
with the given name, if existing.List<Linkpanel>
getLinkPanels()
Messages
getMessages()
MetaData
getMetaData()
Returns theMetaData
of thisFieldProcessor
.org.springframework.data.domain.Pageable
getPageable()
Returns thePageable
for thisFieldProcessor
.String
getReference()
boolean
hasErrors()
boolean
hasField(String fieldBinding)
Checks whether aFieldDef
with the given binding exists for thisFieldProcessor
.boolean
hasFieldErrors()
Checks whether one of the fields has aMessage
of typeMessageType.ERROR
.void
setPageable(org.springframework.data.domain.Pageable pageable)
-
-
-
Method Detail
-
addLinkPanels
public void addLinkPanels(List<Linkpanel> panels)
Description copied from interface:FieldProcessor
Adds the given list ofLinkpanel
s to thisFieldProcessor
- Specified by:
addLinkPanels
in interfaceFieldProcessor
- Parameters:
panels
- a list ofLinkpanel
s
-
getFields
public List<FieldDef> getFields()
Description copied from interface:FieldProcessor
Returns allFieldDef
intions known by thisFieldProcessor
.- Specified by:
getFields
in interfaceFieldProcessor
- Returns:
- a
List
ofFieldDef
intions
-
getField
public FieldDef getField(String fieldBinding)
Description copied from interface:FieldProcessor
Returns theFieldDef
with the given binding, if existing.- Specified by:
getField
in interfaceFieldProcessor
- Parameters:
fieldBinding
- the binding of theFieldDef
to return- Returns:
- the
FieldDef
with the given binding, ornull
if no suchFieldDef
exists - See Also:
FieldDef.getBinding()
-
getLinkPanel
public Linkpanel getLinkPanel(String fieldName)
Description copied from interface:FieldProcessor
Returns theLinkpanel
with the given name, if existing.- Specified by:
getLinkPanel
in interfaceFieldProcessor
- Parameters:
fieldName
- the name of theFieldDef
respectively theLinkpanel
- Returns:
- the
Linkpanel
, if existing,null
otherwise
-
hasField
public boolean hasField(String fieldBinding)
Description copied from interface:FieldProcessor
Checks whether aFieldDef
with the given binding exists for thisFieldProcessor
.- Specified by:
hasField
in interfaceFieldProcessor
- Parameters:
fieldBinding
- the binding of theFieldDef
to check- Returns:
true
if such aFieldDef
exists,false
otherwise.- See Also:
FieldProcessor.getField(String)
-
getReference
public String getReference()
Description copied from interface:FieldProcessor
- Specified by:
getReference
in interfaceFieldProcessor
- Returns:
- the reference id
-
getMetaData
public MetaData getMetaData()
Description copied from interface:FieldProcessor
Returns theMetaData
of thisFieldProcessor
.- Specified by:
getMetaData
in interfaceFieldProcessor
- Returns:
- the
MetaData
-
hasErrors
public boolean hasErrors()
Description copied from interface:FieldProcessor
- Specified by:
hasErrors
in interfaceFieldProcessor
- Returns:
true
if there are anyMessage
s ofMessageType.ERROR
,false
otherwise- See Also:
FieldProcessor.addErrorMessage(String)
,FieldProcessor.addErrorMessage(FieldDef, String)
-
hasFieldErrors
public boolean hasFieldErrors()
Description copied from interface:FieldProcessor
Checks whether one of the fields has aMessage
of typeMessageType.ERROR
.- Specified by:
hasFieldErrors
in interfaceFieldProcessor
- Returns:
true
if any of theFieldProcessor
sFieldDef
s has aMessage
of typeMessageType.ERROR
,false
otherwise- See Also:
FieldProcessor.addErrorMessage(FieldDef, String)
-
addOkMessage
public void addOkMessage(String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.OK
.- Specified by:
addOkMessage
in interfaceFieldProcessor
- Parameters:
message
- the message to add
-
addOkMessage
public void addOkMessage(FieldDef field, String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.OK
to the given field.- Specified by:
addOkMessage
in interfaceFieldProcessor
- Parameters:
field
- theFieldDef
to add theMessage
tomessage
- the message to add
-
addErrorMessage
public void addErrorMessage(String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.ERROR
.- Specified by:
addErrorMessage
in interfaceFieldProcessor
- Parameters:
message
- the message to add- See Also:
FieldProcessor.hasErrors()
-
addErrorMessage
public void addErrorMessage(FieldDef field, String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.ERROR
to the given field.- Specified by:
addErrorMessage
in interfaceFieldProcessor
- Parameters:
field
- theFieldDef
to add theMessage
tomessage
- the message to add- See Also:
FieldProcessor.hasErrors()
,FieldProcessor.hasFieldErrors()
-
addInvalidMessage
public void addInvalidMessage(String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.INVALID
.- Specified by:
addInvalidMessage
in interfaceFieldProcessor
- Parameters:
message
- the message to add
-
addInvalidMessage
public void addInvalidMessage(FieldDef field, String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.INVALID
to the given field.- Specified by:
addInvalidMessage
in interfaceFieldProcessor
- Parameters:
field
- theFieldDef
to add theMessage
tomessage
- the message to add
-
addNoticeMessage
public void addNoticeMessage(String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.INVALID
.- Specified by:
addNoticeMessage
in interfaceFieldProcessor
- Parameters:
message
- the message to add
-
addNoticeMessage
public void addNoticeMessage(FieldDef field, String message)
Description copied from interface:FieldProcessor
Adds aMessage
of typeMessageType.NOTICE
to the given field.- Specified by:
addNoticeMessage
in interfaceFieldProcessor
- Parameters:
field
- theFieldDef
to add theMessage
tomessage
- the message to add
-
getMessages
public Messages getMessages()
Description copied from interface:FieldProcessor
Returns a newMessages
-object containing allMessage
s previously added usingaddXXMessage(String message)
.- Specified by:
getMessages
in interfaceFieldProcessor
- Returns:
- a new
Messages
instance containing the previously addedMessage
s - See Also:
FieldProcessor.addOkMessage(String)
,FieldProcessor.addNoticeMessage(String)
,FieldProcessor.addInvalidMessage(String)
,FieldProcessor.addErrorMessage(String)
-
clearMessages
public void clearMessages()
Description copied from interface:FieldProcessor
Clears allMessage
s which were previously added usingaddXXMessage(String message)
.- Specified by:
clearMessages
in interfaceFieldProcessor
- See Also:
FieldProcessor.addOkMessage(String)
,FieldProcessor.addNoticeMessage(String)
,FieldProcessor.addInvalidMessage(String)
,FieldProcessor.addErrorMessage(String)
-
clearFieldMessages
public void clearFieldMessages()
Description copied from interface:FieldProcessor
Clears allMessage
s which were previously added usingaddXXMessage(FieldDef field, String message)
.
-
clearFieldMessages
public void clearFieldMessages(String... fieldBindings)
Description copied from interface:FieldProcessor
- Specified by:
clearFieldMessages
in interfaceFieldProcessor
- Parameters:
fieldBindings
- the bindings of the fields to clear the messages for- See Also:
FieldProcessor.addOkMessage(FieldDef, String)
,FieldProcessor.addNoticeMessage(FieldDef, String)
,FieldProcessor.addInvalidMessage(FieldDef, String)
,FieldProcessor.addErrorMessage(FieldDef, String)
,FieldDef.getBinding()
-
setPageable
public void setPageable(org.springframework.data.domain.Pageable pageable)
-
getPageable
public org.springframework.data.domain.Pageable getPageable()
Description copied from interface:FieldProcessor
Returns thePageable
for thisFieldProcessor
.- Specified by:
getPageable
in interfaceFieldProcessor
- Returns:
- the
Pageable
-
-