@Test public void testChannelNameExpression() throws Exception { final String b1 = "B1"; document.appendChild(document.createElementNS(SLD.NAMESPACE, "GreenChannel")); Element name = document.createElementNS(SLD.NAMESPACE, "SourceChannelName"); Element expression = document.createElementNS(OGC.NAMESPACE, OGC.Function.getLocalPart()); expression.setAttribute("name", "env"); name.appendChild(expression); Element envName = document.createElementNS(OGC.NAMESPACE, OGC.Literal.getLocalPart()); envName.appendChild(document.createTextNode(b1)); Element envDefaultValue = document.createElementNS(OGC.NAMESPACE, OGC.Literal.getLocalPart()); envDefaultValue.appendChild(document.createTextNode("1")); expression.appendChild(envName); expression.appendChild(envDefaultValue); Element contrast = document.createElementNS(SLD.NAMESPACE, "ContrastEnhancement"); document.getDocumentElement().appendChild(name); document.getDocumentElement().appendChild(contrast); SelectedChannelType channelType = (SelectedChannelType) parse(); assertNotNull(channelType); assertNotNull(channelType.getChannelName()); EnvFunction.removeLocalValue(b1); assertEquals(channelType.getChannelName().evaluate(null, Integer.class).intValue(), 1); EnvFunction.setLocalValue(b1, "12"); assertEquals(channelType.getChannelName().evaluate(null, Integer.class).intValue(), 12); EnvFunction.removeLocalValue(b1); assertNotNull(channelType.getContrastEnhancement()); }
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return styleFactory.createSelectedChannelType( (Expression) node.getChildValue("SourceChannelName"), (ContrastEnhancement) node.getChildValue("ContrastEnhancement")); }
SLDSelectedChannelTypeBinding extends AbstractComplexBinding { public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return styleFactory.createSelectedChannelType( (Expression) node.getChildValue("SourceChannelName"), (ContrastEnhancement) node.getChildValue("ContrastEnhancement")); } }
SLDSelectedChannelTypeBinding extends AbstractComplexBinding { public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return styleFactory.createSelectedChannelType( (Expression) node.getChildValue("SourceChannelName"), (ContrastEnhancement) node.getChildValue("ContrastEnhancement")); } SLDSelectedChannelTypeBinding(StyleFactory styleFactory); }
SLDSelectedChannelTypeBinding extends AbstractComplexBinding { public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return styleFactory.createSelectedChannelType( (Expression) node.getChildValue("SourceChannelName"), (ContrastEnhancement) node.getChildValue("ContrastEnhancement")); } SLDSelectedChannelTypeBinding(StyleFactory styleFactory); QName getTarget(); int getExecutionMode(); Class getType(); void initialize(ElementInstance instance, Node node, MutablePicoContainer context); Object parse(ElementInstance instance, Node node, Object value); }
SLDSelectedChannelTypeBinding extends AbstractComplexBinding { public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return styleFactory.createSelectedChannelType( (Expression) node.getChildValue("SourceChannelName"), (ContrastEnhancement) node.getChildValue("ContrastEnhancement")); } SLDSelectedChannelTypeBinding(StyleFactory styleFactory); QName getTarget(); int getExecutionMode(); Class getType(); void initialize(ElementInstance instance, Node node, MutablePicoContainer context); Object parse(ElementInstance instance, Node node, Object value);  }