Package cern.dip.mock
Class MockDipBrowser
- java.lang.Object
-
- cern.dip.mock.MockDipBrowser
-
- All Implemented Interfaces:
DipBrowser
public class MockDipBrowser extends java.lang.Object implements DipBrowser
-
-
Field Summary
Fields Modifier and Type Field Description MockDipFactory
dipFactory
-
Constructor Summary
Constructors Constructor Description MockDipBrowser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getPublications(java.lang.String pattern)
Obtain a list of all publications visable in the DIP namespace.int
getSize()
Get the cardinality of the default field (where a primitive type is being sent).int
getSize(java.lang.String tag)
Get the cardinality of the field who's name is supplied as a parameter.java.lang.String[]
getTags(java.lang.String pub)
Get the fields names within the publication having the supplied publication name.int
getType()
Get the type of the default field (where a primitive type is being sent).int
getType(java.lang.String tag)
Get the type of the field who's name is supplied as a parameter.
-
-
-
Field Detail
-
dipFactory
public MockDipFactory dipFactory
-
-
Method Detail
-
getPublications
public java.lang.String[] getPublications(java.lang.String pattern)
Description copied from interface:DipBrowser
Obtain a list of all publications visable in the DIP namespace. If no publications are visable an empty array is returned.- Specified by:
getPublications
in interfaceDipBrowser
- Parameters:
pattern
- wildcard string. * @return array of publication names.
-
getTags
public java.lang.String[] getTags(java.lang.String pub) throws DipException
Description copied from interface:DipBrowser
Get the fields names within the publication having the supplied publication name. Should always be at least one field. A primitive type will return the tag name __DIP_DEFAULT__- Specified by:
getTags
in interfaceDipBrowser
- Parameters:
pub
- name of the publication we want the fields of.- Returns:
- Array of fields within the publication.
- Throws:
DipException
- if the format discription of the publication is incorrect
-
getType
public int getType() throws DipException
Description copied from interface:DipBrowser
Get the type of the default field (where a primitive type is being sent). Must be called after first calling getTags() for the publication of interest.- Specified by:
getType
in interfaceDipBrowser
- Returns:
- type of the primitive sent in the DipData object as defined in the DipData class
- Throws:
DipException
- if getTags() has not been previous called or the object does not hold a primitive type- See Also:
DipData
-
getSize
public int getSize() throws DipException
Description copied from interface:DipBrowser
Get the cardinality of the default field (where a primitive type is being sent). Must be called after first calling getTags() for the publication of interest. Note that a non array type will return the value 1.- Specified by:
getSize
in interfaceDipBrowser
- Returns:
- cardinality of the primitive sent in the DipData object.
- Throws:
DipException
- if getTags() has not been previous called or the object does not hold a primitive type- See Also:
DipData
-
getType
public int getType(java.lang.String tag) throws DipException
Description copied from interface:DipBrowser
Get the type of the field who's name is supplied as a parameter. Must be called after first calling getTags() for the publication of interest.- Specified by:
getType
in interfaceDipBrowser
- Returns:
- type of the field sent in the DipData object as defined in the DipData class
- Throws:
DipException
- if getTags() has not been previous called or the object does not hold a complex type- See Also:
getTags()
,DipData
-
getSize
public int getSize(java.lang.String tag) throws DipException
Description copied from interface:DipBrowser
Get the cardinality of the field who's name is supplied as a parameter. Must be called after first calling getTags() for the publication of interest. Note that a non array type will return the value 1.- Specified by:
getSize
in interfaceDipBrowser
- Returns:
- cardinality of the field sent in the DipData object as defined in the DipData class
- Throws:
DipException
- if getTags() has not been previous called or the object does not hold a complex type- See Also:
DipData
-
-