com.ihr.xbrl.filters
Class CompanyFilter

java.lang.Object
  extended by com.ihr.xbrl.filters.CompanyFilter
All Implemented Interfaces:
XBRLFilterInterface

public class CompanyFilter
extends java.lang.Object
implements XBRLFilterInterface

Author:
Ignacio

Method Summary
 java.lang.String getAsString()
          Returns the string representation of this filter
static java.lang.String getMainFilterArgument(java.lang.String text)
          If the function isTypeOfFilter returns true, some filters are very simple and only requires one single argument to be passed in (a text string). for those cases, this function should return the filter argument.
 java.lang.String getTable()
          Returns the name of a new table to be added to the filter query
 java.lang.String getTableWhere()
          Returns the where clause that joins the table with the existing XBRLFactItems table
 java.lang.String getWhere()
          Returns the text of the where clause (without the "and" clause) there is only one if the XBRLFilterInterface.hasWhereClause() function has returned true.
 boolean hasTables()
          This shall return true if the filter requires a new table to be inserted in the query.
 boolean hasWhereClause()
          Returns true if the filter is able to provide a where clause to the query statement.
static boolean isTypeOfFilter(java.lang.String text)
          Returns true is the text string passed in as argument in text can be converted into a filter of this type using a static factory method.
static XBRLFilterInterface newCompanyFilter(java.lang.String text, org.hibernate.Session session)
          Reverse operation of getAsString()
static XBRLFilterInterface newCompanyFilter(XBRLEntity entity, XBRLInstance instance, org.hibernate.Session session)
           
 void removeFactsNotPass(java.util.List<?> lst)
           
 org.hibernate.Query setParameters(org.hibernate.Query q)
          Fills in the parameter values for this query in the where clause
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAsString

public java.lang.String getAsString()
Description copied from interface: XBRLFilterInterface
Returns the string representation of this filter

Specified by:
getAsString in interface XBRLFilterInterface
Returns:

newCompanyFilter

public static XBRLFilterInterface newCompanyFilter(java.lang.String text,
                                                   org.hibernate.Session session)
                                            throws FilterException
Reverse operation of getAsString()

Parameters:
text -
session -
Returns:
Throws:
FilterException

removeFactsNotPass

public void removeFactsNotPass(java.util.List<?> lst)
Specified by:
removeFactsNotPass in interface XBRLFilterInterface

newCompanyFilter

public static XBRLFilterInterface newCompanyFilter(XBRLEntity entity,
                                                   XBRLInstance instance,
                                                   org.hibernate.Session session)
Parameters:
db -
entity -
Returns:

isTypeOfFilter

public static boolean isTypeOfFilter(java.lang.String text)
Returns true is the text string passed in as argument in text can be converted into a filter of this type using a static factory method.

Parameters:
text -
Returns:
boolean value

getMainFilterArgument

public static java.lang.String getMainFilterArgument(java.lang.String text)
If the function isTypeOfFilter returns true, some filters are very simple and only requires one single argument to be passed in (a text string). for those cases, this function should return the filter argument.

Parameters:
text -
Returns:

getWhere

public java.lang.String getWhere()
                          throws java.lang.IllegalAccessException
Description copied from interface: XBRLFilterInterface
Returns the text of the where clause (without the "and" clause) there is only one if the XBRLFilterInterface.hasWhereClause() function has returned true.

When preparing the returned string, f is the XBRLFact pojo instance other classes may use in the where clause

Specified by:
getWhere in interface XBRLFilterInterface
Returns:
Throws:
java.lang.IllegalAccessException - if the class does not implements this method

hasWhereClause

public boolean hasWhereClause()
Description copied from interface: XBRLFilterInterface
Returns true if the filter is able to provide a where clause to the query statement.

Specified by:
hasWhereClause in interface XBRLFilterInterface
Returns:
boolean

setParameters

public org.hibernate.Query setParameters(org.hibernate.Query q)
                                  throws java.lang.IllegalAccessException
Description copied from interface: XBRLFilterInterface
Fills in the parameter values for this query in the where clause

Specified by:
setParameters in interface XBRLFilterInterface
Parameters:
q - the query without the parameters filled in.
Returns:
Query with the parameters filled in
Throws:
java.lang.IllegalAccessException - if the class does not implements this method

hasTables

public boolean hasTables()
Description copied from interface: XBRLFilterInterface
This shall return true if the filter requires a new table to be inserted in the query. If the return value is true, getTable() and getTableWhere() will be called to obtain the required values.

Specified by:
hasTables in interface XBRLFilterInterface
Returns:
boolean value

getTable

public java.lang.String getTable()
                          throws java.lang.IllegalAccessException
Description copied from interface: XBRLFilterInterface
Returns the name of a new table to be added to the filter query

Specified by:
getTable in interface XBRLFilterInterface
Returns:
String with the name of the table to be added and alias for the table
Throws:
java.lang.IllegalAccessException - if the method is called for a filter that does not adds tables

getTableWhere

public java.lang.String getTableWhere()
                               throws java.lang.IllegalAccessException
Description copied from interface: XBRLFilterInterface
Returns the where clause that joins the table with the existing XBRLFactItems table

Specified by:
getTableWhere in interface XBRLFilterInterface
Returns:
String with the where clause
Throws:
java.lang.IllegalAccessException - if the method is called on a filter that does not adds tables


Copyright 2006-2009 Reporting Standard S.L., C/ Torrecilla del Puerto 1, 28043, Madrid, Espaņa