Package org.intermine.web.logic.query
Class MetadataNode
- java.lang.Object
-
- org.intermine.pathquery.Node
-
- org.intermine.web.logic.query.MetadataNode
-
public class MetadataNode extends Node
Node used in displaying metadata- Author:
- Mark Woodbridge
-
-
Constructor Summary
Constructors Constructor Description MetadataNode(java.lang.String type, java.util.List<java.lang.String> structure, PathQuery query, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, BagManager bagManager, Profile profile)
Constructor for a root nodeMetadataNode(MetadataNode parent, java.lang.String fieldName, java.lang.String button, java.util.List<java.lang.String> structure, PathQuery query, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, BagManager bagManager, Profile profile, java.lang.Boolean isNull)
Constructor for a non-root node
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getButton()
Gets the value of buttonboolean
getCanCreateConstraint()
Returns true if there is any possibility of creating a constraint on this path.boolean
getHasAvailableBags()
Returns true if there are any available bags for the type of this path.boolean
getHasClassKeys()
Returns true if the type of this path has class keys configured.boolean
getHasPossibleLoops()
Returns true if this path in the query has possible loop constraints that are not already in the query.boolean
getHasSubclasses()
Returns true if the original type has subclasses in the model.boolean
getIsNull()
java.lang.String
getOrigType()
Returns the type of this node if it did not have a subclass constraint.java.util.List<java.lang.String>
getStructure()
Returns the structure of the tree.boolean
isReverseReference()
Returns true if this path is a reverse reference back onto the previous node.boolean
isSelected()
Get the value of selectedvoid
setModel(Model model)
Attach the model.void
setSelected(boolean selected)
Sets the value of selectedvoid
setType(java.lang.String type)
Set the value of typejava.lang.String
toString()
-
Methods inherited from class org.intermine.pathquery.Node
equals, getFieldDescriptor, getFieldName, getFriendlyName, getIndentation, getMinimalPath, getOuterJoinGroup, getOuterJoinGroup, getParent, getParentType, getPathString, getPrefix, getType, hashCode, isAttribute, isCollection, isOuterJoin, isReference, setOuterJoin
-
-
-
-
Constructor Detail
-
MetadataNode
public MetadataNode(java.lang.String type, java.util.List<java.lang.String> structure, PathQuery query, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, BagManager bagManager, Profile profile)
Constructor for a root node- Parameters:
type
- the root type of this treestructure
- a List of Strings - for definition, see getStructure()query
- a PathQuery, for working out possible loopsclassKeys
- a Map of class keys, for working out if a path has anybagManager
- a BagManager object, for working out if it is possible to constrain by bagprofile
- the profile of the current user, for fetching bags from the BagManager
-
MetadataNode
public MetadataNode(MetadataNode parent, java.lang.String fieldName, java.lang.String button, java.util.List<java.lang.String> structure, PathQuery query, java.util.Map<java.lang.String,java.util.List<FieldDescriptor>> classKeys, BagManager bagManager, Profile profile, java.lang.Boolean isNull)
Constructor for a non-root node- Parameters:
parent
- the parent node of this nodefieldName
- the name of the field that this node representsbutton
- the button displayed next to this node's namestructure
- a List of Strings - for definition, see getStructure()query
- a PathQuery, for working out possible loopsclassKeys
- a Map of class keys, for working out if a path has anybagManager
- a BagManager object, for working out if it is possible to constrain by bagprofile
- the profile of the current user, for fetching bags from the BagManagerisNull
- is the field null or empty? (OS-Summary determined)
-
-
Method Detail
-
setModel
public void setModel(Model model)
Description copied from class:Node
Attach the model. Throws IllegalArgumentExceptions if node doesn't map onto the model.
-
setType
public void setType(java.lang.String type)
Set the value of type
-
getButton
public java.lang.String getButton()
Gets the value of button- Returns:
- the value of button
-
isSelected
public boolean isSelected()
Get the value of selected- Returns:
- the value of selected as a boolean
-
setSelected
public void setSelected(boolean selected)
Sets the value of selected- Parameters:
selected
- a boolean
-
getStructure
public java.util.List<java.lang.String> getStructure()
Returns the structure of the tree. This is an array of Strings, which are one of four possible strings, in order to draw a tree structure:- blank - Do not draw any lines.
- straight - Draw a straight vertical line.
- ell - Draw an L-shaped line.
- tee - Draw a T-junction, with lines going vertically and to the right.
- Returns:
- a List of Strings
-
getOrigType
public java.lang.String getOrigType()
Returns the type of this node if it did not have a subclass constraint.- Returns:
- a String type name
-
getHasSubclasses
public boolean getHasSubclasses()
Returns true if the original type has subclasses in the model.- Returns:
- a boolean
-
isReverseReference
public boolean isReverseReference()
Returns true if this path is a reverse reference back onto the previous node.- Returns:
- a boolean
-
getHasPossibleLoops
public boolean getHasPossibleLoops() throws PathException
Returns true if this path in the query has possible loop constraints that are not already in the query.- Returns:
- a boolean
- Throws:
PathException
- if the query is invalid
-
getHasClassKeys
public boolean getHasClassKeys()
Returns true if the type of this path has class keys configured.- Returns:
- a boolean
-
getHasAvailableBags
public boolean getHasAvailableBags()
Returns true if there are any available bags for the type of this path.- Returns:
- a boolean
-
getCanCreateConstraint
public boolean getCanCreateConstraint() throws PathException
Returns true if there is any possibility of creating a constraint on this path.- Returns:
- a boolean
- Throws:
PathException
- if the query is invalid
-
getIsNull
public boolean getIsNull()
- Returns:
- a boolean is this Node is null or empty as determined by OSS
-
-