void setComment(String comment){ if (this.elementStarted) { Assertion.failed("Comment must not be added to Element after Element is started."); //$NON-NLS-1$ } this.comment = comment; }
public static final void assertTrue(boolean condition, String msgKey) { if(! condition) { final String msg = msgKey != null ? msgKey : CorePlugin.Util.getString("Assertion.Assertion_failed"); //$NON-NLS-1$ failed(msg); } }
public static final void isNull(Object value, String message) { if ( value != null ) { final String msg = message != null ? message : CorePlugin.Util.getString("Assertion.isNull"); //$NON-NLS-1$ failed(msg); } }
public static final void assertTrue(boolean condition, String msgKey) { if(! condition) { final String msg = msgKey != null ? msgKey : CorePlugin.Util.getString("Assertion.Assertion_failed"); //$NON-NLS-1$ failed(msg); } }
/** * Set the underlying symbol * @param symbol New symbol */ public void setSymbol(Expression symbol) { if(symbol instanceof AliasSymbol || symbol == null){ Assertion.failed(QueryPlugin.Util.getString("ERR.015.010.0029")); //$NON-NLS-1$ } this.symbol = symbol; }
public static final void isNotNull(Object value, String message) { if ( value == null ) { final String msg = message != null ? message : CorePlugin.Util.getString("Assertion.isNotNull"); //$NON-NLS-1$ failed(msg); } }
public static final void isNull(Object value, String message) { if ( value != null ) { final String msg = message != null ? message : CorePlugin.Util.getString("Assertion.isNull"); //$NON-NLS-1$ failed(msg); } }
public static final void isNotNull(Object value, String message) { if ( value == null ) { final String msg = message != null ? message : CorePlugin.Util.getString("Assertion.isNotNull"); //$NON-NLS-1$ failed(msg); } }
/** * Set the underlying symbol * @param symbol New symbol */ public void setSymbol(Expression symbol) { if(symbol instanceof AliasSymbol || symbol == null){ Assertion.failed(QueryPlugin.Util.getString("ERR.015.010.0029")); //$NON-NLS-1$ } this.symbol = symbol; }
/** * Set the underlying symbol * @param symbol New symbol */ public void setSymbol(Expression symbol) { if(symbol instanceof AliasSymbol || symbol == null){ Assertion.failed(QueryPlugin.Util.getString("ERR.015.010.0029")); //$NON-NLS-1$ } this.symbol = symbol; }
int getOperator(String opString) { if (opString.equals("=")) { //$NON-NLS-1$ return CompareCriteria.EQ; } else if (opString.equals("<>") || opString.equals("!=")) { //$NON-NLS-1$ //$NON-NLS-2$ return CompareCriteria.NE; } else if (opString.equals("<")) { //$NON-NLS-1$ return CompareCriteria.LT; } else if (opString.equals(">")) { //$NON-NLS-1$ return CompareCriteria.GT; } else if (opString.equals("<=")) { //$NON-NLS-1$ return CompareCriteria.LE; } else if (opString.equals(">=")) { //$NON-NLS-1$ return CompareCriteria.GE; } Assertion.failed("unknown operator"); //$NON-NLS-1$ return 0; }
int getOperator(String opString) { if (opString.equals("=")) { //$NON-NLS-1$ return CompareCriteria.EQ; } else if (opString.equals("<>") || opString.equals("!=")) { //$NON-NLS-1$ //$NON-NLS-2$ return CompareCriteria.NE; } else if (opString.equals("<")) { //$NON-NLS-1$ return CompareCriteria.LT; } else if (opString.equals(">")) { //$NON-NLS-1$ return CompareCriteria.GT; } else if (opString.equals("<=")) { //$NON-NLS-1$ return CompareCriteria.LE; } else if (opString.equals(">=")) { //$NON-NLS-1$ return CompareCriteria.GE; } Assertion.failed("unknown operator"); //$NON-NLS-1$ return 0; }
int getOperator(String opString) { if (opString.equals("=")) { //$NON-NLS-1$ return CompareCriteria.EQ; } else if (opString.equals("<>") || opString.equals("!=")) { //$NON-NLS-1$ //$NON-NLS-2$ return CompareCriteria.NE; } else if (opString.equals("<")) { //$NON-NLS-1$ return CompareCriteria.LT; } else if (opString.equals(">")) { //$NON-NLS-1$ return CompareCriteria.GT; } else if (opString.equals("<=")) { //$NON-NLS-1$ return CompareCriteria.LE; } else if (opString.equals(">=")) { //$NON-NLS-1$ return CompareCriteria.GE; } Assertion.failed("unknown operator"); //$NON-NLS-1$ return 0; }
void setAttribute(NodeDescriptor descriptor, String value){ if (this.elementStarted) { Assertion.failed("Attributes must not be added to Element after Element is started."); //$NON-NLS-1$ } if(attributes == null) { attributes = new AttributesImpl(); } attributes.addAttribute(descriptor.getNamespaceURI(), descriptor.getName(), descriptor.getQName(), DEFAULT_ATTRIBUTE_TYPE, value); }
/** * Finds the closest project columns in the current frame */ static List<Expression> findTopCols(PlanNode node) { PlanNode project = NodeEditor.findNodePreOrder(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); if (project == null) { project = NodeEditor.findParent(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); } if (project != null) { return (List<Expression>)project.getProperty(NodeConstants.Info.PROJECT_COLS); } Assertion.failed("no top cols in frame"); //$NON-NLS-1$ return null; }
/** * Finds the closest project columns in the current frame */ static List<Expression> findTopCols(PlanNode node) { PlanNode project = NodeEditor.findNodePreOrder(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); if (project == null) { project = NodeEditor.findParent(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); } if (project != null) { return (List<Expression>)project.getProperty(NodeConstants.Info.PROJECT_COLS); } Assertion.failed("no top cols in frame"); //$NON-NLS-1$ return null; }
/** * Finds the closest project columns in the current frame */ static List<Expression> findTopCols(PlanNode node) { PlanNode project = NodeEditor.findNodePreOrder(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); if (project == null) { project = NodeEditor.findParent(node, NodeConstants.Types.PROJECT, NodeConstants.Types.SOURCE); } if (project != null) { return (List<Expression>)project.getProperty(NodeConstants.Info.PROJECT_COLS); } Assertion.failed("no top cols in frame"); //$NON-NLS-1$ return null; }
public void testFailed() { try { Assertion.failed(null); fail(); } catch ( AssertionError e ) { // expected, but check the message assertEquals("null", e.getMessage()); //$NON-NLS-1$ } try { Assertion.failed(TEST_MESSAGE); fail(); } catch ( AssertionError e ) { // expected, but check the message assertEquals(TEST_MESSAGE, e.getMessage()); } }
newValues.add(expression); } else { Assertion.failed("Cannot determine element or expression type"); //$NON-NLS-1$
/** * @see ProcessorInstruction#process(ProcessorEnvironment) */ public XMLContext process(XMLProcessorEnvironment env, XMLContext context) throws BlockedException, TeiidComponentException, TeiidProcessingException{ DocumentInProgress doc = env.getDocumentInProgress(); switch(this.direction) { case UP: LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, "UP in document"); //$NON-NLS-1$ try { doc.moveToParent(); } catch (SAXException err) { throw new TeiidComponentException(QueryPlugin.Event.TEIID30193, err, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30193)); } break; case DOWN: LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, "LAST child in document"); //$NON-NLS-1$ doc.moveToLastChild(); break; default: Assertion.failed(QueryPlugin.Util.getString("ERR.015.006.0051", direction)); //$NON-NLS-1$ break; } env.incrementCurrentProgramCounter(); return context; }