Java Doc for AbstractBasicConverter.java in  » Search-Engine » compass-2.0 » org » compass » core » converter » basic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Search Engine » compass 2.0 » org.compass.core.converter.basic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.compass.core.converter.basic.AbstractBasicConverter

All known Subclasses:   org.compass.core.test.compositeid.CompositeIdConverter,  org.compass.core.test.managedidconverter.SimpleConverter,  org.compass.core.converter.basic.AbstractFormatConverter,  org.compass.core.converter.basic.URLConverter,  org.compass.core.converter.basic.StringBufferConverter,  org.compass.core.converter.basic.StringConverter,  org.compass.core.converter.basic.StringBuilderConverter,  org.compass.core.converter.extended.FileConverter,  org.compass.core.test.converter.SampleConverter,  org.compass.core.converter.basic.ByteConverter,  org.compass.core.test.reference.withprop.BConverter,  org.compass.core.converter.basic.EnumConverter,  org.compass.core.converter.basic.URIConverter,  org.compass.core.test.component.override.BConverter,  org.compass.core.converter.dynamic.AbstractDynamicConverter,  org.compass.core.converter.basic.CharConverter,  org.compass.core.converter.extended.LocaleConverter,  org.compass.core.converter.basic.BooleanConverter,  org.compass.annotations.test.ConvertedConverter,
AbstractBasicConverter
abstract public class AbstractBasicConverter implements ResourcePropertyConverter(Code)
An easy to use abstact class for Basic converters. Handles converters that usually deals with String as a result of the conversion.

Allows to override the actual marshalling and un-marshalling of object to strings. In order to override marshalling, override AbstractBasicConverter.doToString(Object,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) and in order to override un-marshalling overrode AbstractBasicConverter.doFromString(String,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) .
author:
   kimchy





Method Summary
public  booleancanNormalize()
     Return false.
protected  PropertycreateProperty(String value, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
     Creates a new property to be added to the resource during the marshalling process.
abstract protected  ObjectdoFromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
     Override the from String in order to un-marshall the String back into its object representation.
protected  voiddoSetBoost(Property property, Object root, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
    

A simple extension point that allows to set the boost value for the created Property .

protected  StringdoToString(Object o, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
     Allows to override to toString operation.
public  ObjectfromString(String str, ResourcePropertyMapping resourcePropertyMapping)
     Calls AbstractBasicConverter.fromString(String,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) with a null value for the context.
protected  ObjectfromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
     Performs null checks (by calling AbstractBasicConverter.isNullValue(String,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) ) and then calls AbstractBasicConverter.doFromString(String,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) if the value is not null.
protected  StringgetNullValue(ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
     If the converter handle nulls, the value that will be stored in the search engine for null values (during the marshall process).
protected  booleanhandleNulls(ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
    

Should the converter handle nulls? Handling nulls means should the converter process nulls or not.

protected  booleanisNullValue(String value, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
     Does this value represents a null value.
public  booleanmarshall(Resource resource, Object root, Mapping mapping, MarshallingContext context)
    
public  StringtoString(Object o, ResourcePropertyMapping resourcePropertyMapping)
     Implementation calls AbstractBasicConverter.toString(Object,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) with null value for the context parameter.
protected  StringtoString(Object o, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
     Implementation handle nulls and if the object is not null, delegates to AbstractBasicConverter.doToString(Object,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) .
public  Objectunmarshall(Resource resource, Mapping mapping, MarshallingContext context)
    



Method Detail
canNormalize
public boolean canNormalize()(Code)
Return false. Specific parsers that can convert on query string should override this method and return true.



createProperty
protected Property createProperty(String value, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)(Code)
Creates a new property to be added to the resource during the marshalling process. Allows sub classes to override ti in order to modify the created property.
Parameters:
  value - The value of the property
Parameters:
  resourcePropertyMapping - The resource mapping definition of the property
Parameters:
  context - The context (allows to get the search engine from it) The property to be added to the Resource



doFromString
abstract protected Object doFromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context) throws ConversionException(Code)
Override the from String in order to un-marshall the String back into its object representation.



doSetBoost
protected void doSetBoost(Property property, Object root, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context) throws ConversionException(Code)

A simple extension point that allows to set the boost value for the created Property .

The default implemenation uses the statically defined boost value in the mapping definition ( org.compass.core.mapping.ResourcePropertyMapping.getBoost ) to set the boost level using Property.setBoost(float)
Parameters:
  property - The property to set the boost on
Parameters:
  root - The object that is marshalled into a property
Parameters:
  resourcePropertyMapping - The Resource Property Mapping definition
throws:
  ConversionException -




doToString
protected String doToString(Object o, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)(Code)
Allows to override to toString operation. Default implementation calls the object toString.

Note, the marshalling context might be null.




fromString
public Object fromString(String str, ResourcePropertyMapping resourcePropertyMapping) throws ConversionException(Code)
Calls AbstractBasicConverter.fromString(String,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) with a null value for the context.



fromString
protected Object fromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context) throws ConversionException(Code)
Performs null checks (by calling AbstractBasicConverter.isNullValue(String,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) ) and then calls AbstractBasicConverter.doFromString(String,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) if the value is not null.



getNullValue
protected String getNullValue(ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)(Code)
If the converter handle nulls, the value that will be stored in the search engine for null values (during the marshall process). Uses org.compass.core.mapping.ResourcePropertyMapping.getNullValue .
Parameters:
  resourcePropertyMapping - The resource proeprty mapping to get the null value from
Parameters:
  context - The marshalling context Null value that will be inserted for nulls.



handleNulls
protected boolean handleNulls(ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)(Code)

Should the converter handle nulls? Handling nulls means should the converter process nulls or not. Usually the converter will not persist null values, but sometimes it might be needed ( org.compass.core.marshall.MarshallingContext.handleNulls ).

If a specific null value is configured with the org.compass.core.mapping.ResourcePropertyMapping then the converter will always handle nulls and write it.
Parameters:
  context - The marshalling context true if the converter should handle null values




isNullValue
protected boolean isNullValue(String value, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)(Code)
Does this value represents a null value. If the org.compass.core.mapping.ResourcePropertyMapping is configured with a null value, then returns true if the null value equals the value read from the index. If the resource property mapping is not configured with a null value, checks if this it has the default value representing a null value.



marshall
public boolean marshall(Resource resource, Object root, Mapping mapping, MarshallingContext context) throws ConversionException(Code)



toString
public String toString(Object o, ResourcePropertyMapping resourcePropertyMapping)(Code)
Implementation calls AbstractBasicConverter.toString(Object,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) with null value for the context parameter.

Note, please don't override this method, please override AbstractBasicConverter.doToString(Object,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) to change the how the object gets marshalled into a String.




toString
protected String toString(Object o, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)(Code)
Implementation handle nulls and if the object is not null, delegates to AbstractBasicConverter.doToString(Object,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) .

Note, please don't override this method, please override AbstractBasicConverter.doToString(Object,org.compass.core.mapping.ResourcePropertyMapping,org.compass.core.marshall.MarshallingContext) to change the how the object gets marshalled into a String.




unmarshall
public Object unmarshall(Resource resource, Mapping mapping, MarshallingContext context) throws ConversionException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.