JXPath with boolean value

Hi,
I want to know if JXPath support boolean value or not, and how to do.Because if i try to get the value of a bollean attribute with the getValue(..) method, it does'nt work..
Thanks

Hi,
This forum is dedicated to JMX.
You're asking a question about JXPath, which is not even closely related to the technology this forum is about.
Maybe someone reading your post will have an answer for you, but it would be sheer luck.
Maybe this link will have the answer you're looking for:
http://today.java.net/pub/a/today/2006/08/03/java-object-querying-using-jxpath.html
If not you could try to google search for JXPath, or try to find a better suited forum here:
http://forum.java.sun.com/index.jspa?tab=java
Hope this helps,
-- daniel
http://blogs.sun.com/jmxetc

Similar Messages

  • Cell with boolean value not rendering properly in Swing (custom renderer)

    Hello All,
    I have a problem rendenring boolean values when using a custom cell renderer inside a JTable; I managed to reproduce the issue with a dummy application. The application code follows:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.lang.reflect.InvocationTargetException;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    * Simple GUI that uses custom cell rendering
    * @author josevnz
    public final class SimpleGui extends JFrame {
         private static final long serialVersionUID = 1L;
         private Logger log = Logger.getLogger(SimpleGui.class.getName());
         private JTable simpleTable;
         public SimpleGui() {
              super("Simple GUI");
              setPreferredSize(new Dimension(500, 500));
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setLayout(new BorderLayout());
         public void constructGui() {
              simpleTable = new JTable(new SimpleTableModel());
              simpleTable.getColumnModel().getColumn(2).setCellRenderer(new HasItCellRenderer());
              SpecialCellRenderer specRen = new SpecialCellRenderer(log);
              simpleTable.setDefaultRenderer(Double.class, specRen);
              simpleTable.setDefaultRenderer(String.class, specRen);
              simpleTable.setDefaultRenderer(Date.class, specRen);
              //simpleTable.setDefaultRenderer(Boolean.class, specRen);
              add(new JScrollPane(simpleTable), BorderLayout.CENTER);          
              pack();
              setVisible(true);
         private void populate() {
              List <List<Object>>people = new ArrayList<List<Object>>();
              List <Object>people1 = new ArrayList<Object>();
              people1.add(0, "Jose");
              people1.add(1, 500.333333567);
              people1.add(2, Boolean.TRUE);
              people1.add(3, new Date());
              people.add(people1);
              List <Object>people2 = new ArrayList<Object>();
              people2.add(0, "Yes, you!");
              people2.add(1, 100.522222);
              people2.add(2, Boolean.FALSE);
              people2.add(3, new Date());
              people.add(people2);
              List <Object>people3 = new ArrayList<Object>();
              people3.add(0, "Who, me?");
              people3.add(1, 0.00001);
              people3.add(2, Boolean.TRUE);
              people3.add(3, new Date());
              people.add(people3);
              List <Object>people4 = new ArrayList<Object>();
              people4.add(0, "Peter Parker");
              people4.add(1, 11.567444444);
              people4.add(2, Boolean.FALSE);
              people4.add(3, new Date());
              people.add(people4);
              ((SimpleTableModel) simpleTable.getModel()).addAll(people);
          * @param args
          * @throws InvocationTargetException
          * @throws InterruptedException
         public static void main(String[] args) throws InterruptedException, InvocationTargetException {
              final SimpleGui instance = new SimpleGui();
              SwingUtilities.invokeAndWait(new Runnable() {
                   @Override
                   public void run() {
                        instance.constructGui();
              instance.populate();
    }I decided to write a more specific renderer just for that column:
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.table.DefaultTableCellRenderer;
    * Cell renderer used only by the DividendElement table
    * @author josevnz
    final class HasItCellRenderer extends DefaultTableCellRenderer {
         protected static final long serialVersionUID = 2596173912618784286L;
         private Color hasIt = new Color(255, 225, 0);
         public HasItCellRenderer() {
              super();
              setOpaque(true);
         @Override
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              Component comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
              int desCol = table.convertColumnIndexToView(1);
              if (! isSelected && value instanceof Boolean && column == desCol) {
                   if (((Boolean) value).booleanValue()) {
                        comp.setForeground(hasIt);     
                   } else {
                        comp.setForeground(UIManager.getColor("table.foreground"));
              return comp;
          * Override for performance reasons
         @Override
         public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
              // EMPTY
         @Override
         protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
              // EMPTY
         @Override
         public void revalidate() {
              // EMPTY
         @Override
         public void validate() {
              // EMPTY
    } // end classBut the rendering comes all wrong (a String saying true or false, not the expected checkbox from the default renderer) and also there is a weird flickring effect as this particular boolean column is editable (per table model, not show here)...
    I can post the table model and the other renderer if needed (didn't want to put too much code on the question, at least initiallty).
    Should I render a checkbox myself for this cell in the custom renderer? I'm puzzled as I expected the default renderer part of the code to do this for me instead.
    Thanks!
    Edited by: josevnz on Apr 14, 2009 12:35 PM
    Edited by: josevnz on Apr 14, 2009 12:37 PM

    camickr
    Thats because the default render is a JLabel and it just displays the text from the toString() method of the Object in the table model.What I meant to say is that I expected the JCheckbox not a String representation of the boolean value.
    Thats because a different renderer is used depending on the Class of data in the column. Look at the source code for the JTable class to see what the "default >renderer for the Boolean class" is. Then you can extend that or if its a private class then you will need to copy all the code and customize it.At the end I looked at the code and replicated the functionality I needed. I thought than maybe there was a way to avoid replicating the same logic all over again in order to implement this functionality. Good advice, though.
    see you learned nothing from your last posting. This is NOT a SSCCE. 90% of the code you posted is completely irrelevant for the described problem. There is abosutelly no need to post the custom TableModel, because there is no need to use a custom TableModel for this problem. The TableModel has nothing to do with how a column is rendererd.The custom table model returns the type of the column (giving a hint to the renderer on what to expect, right?) and for the one that had a problem it says than the class is Boolean. That's why I mentioned it:
    public Class getColumnClass(int columnIndex) {
        // Code omited....
    You also posted data for 4 columns worth of data. Again, irrelevant. Your question is about a single column containing Boolean data, so forget about the other columns.
    When creating a SSCCE you don't start with your existing code and "remove" code. You start with a brand new class and only add in what is important. That way hopefully if you made a mistake the first time you don't repeat it the second time.That's what I did, is not the real application. I copy & pasted code in a haste from this dummy program on this forum, not the best approach as it gave the wrong impression.
    Learn how to write a proper SSCCE if you want help in the future. Point taken, but there is NO need for you to be rude. Your help is appreciated.
    Regards,
    Jose.

  • Query with boolean values

    Hi all,
    is it possible to create query which check boolean attributes? If yes, how?
    Thanks,
    Michele

    Hi Michele,
    If you have an attribute (e.g. "Active") of type boolean, then it should be something like:
    QueryExp exp = Query.eq(Query.attr("Active"),Query.value(true));Hope this helps,
    -- daniel
    JMX, SNMP, Java, etc...
    http://blogs.sun.com/jmxetc

  • SetProperty giving error with boolean values

    I created a boolean property in the property sets. When I try to change the
    value using setProperty, I keep getting the following error.
    \_full_disclaimer.java:134: cannot resolve symbol
    symbol : method setValue (boolean)
    location: class com.beasys.commerce.user.jsp.tags.SetPropertyTag
    umsetProperty0.setValue(trueValue);
    ile://[ /portals/repository/full_disclaimer.jsp; Line: 19]
    ^
    1 error
    JSP Code snippit:
    <%
    // Check for submit parameter
    String strSubmit = request.getParameter("submit"); if (strSubmit==null)
    strSubmit="";
    if (strSubmit.equalsIgnoreCase("Accept")) {
    boolean trueValue = true;
    %>
    <um:setProperty propertyName="legaldisclaimer"
    propertySet="<%=portalName%>" value="<%=trueValue%>" />
    <jsp:forward page="<%=createURL(request, "portal.jsp", null)%>"/>
    <%
    %>
    Any ideas why this is happening, and more importantly, what do I need to do
    so I get the desired results????
    Thanks,
    Ken Lee
    [email protected]

    Ken,
    Use a Boolean Object instance.
    Sincerely,
    Daniel Selman
    "Kenneth Lee" <[email protected]> wrote in message
    news:[email protected]..
    I created a boolean property in the property sets. When I try to changethe
    value using setProperty, I keep getting the following error.
    \_full_disclaimer.java:134: cannot resolve symbol
    symbol : method setValue (boolean)
    location: class com.beasys.commerce.user.jsp.tags.SetPropertyTag
    umsetProperty0.setValue(trueValue);
    ile://[ /portals/repository/full_disclaimer.jsp; Line: 19]
    ^
    1 error
    JSP Code snippit:
    <%
    // Check for submit parameter
    String strSubmit = request.getParameter("submit"); if (strSubmit==null)
    strSubmit="";
    if (strSubmit.equalsIgnoreCase("Accept")) {
    boolean trueValue = true;
    %>
    <um:setProperty propertyName="legaldisclaimer"
    propertySet="<%=portalName%>" value="<%=trueValue%>" />
    <jsp:forward page="<%=createURL(request, "portal.jsp", null)%>"/>
    <%
    %>
    Any ideas why this is happening, and more importantly, what do I need todo
    so I get the desired results????
    Thanks,
    Ken Lee
    [email protected]

  • UCCX 10.5 Scripting: Allowing a CAD Task Button to Change A Boolean Value to Skip a Screen Pop

    Good Morning All...
    I've found some wonderful information on here in the past and I'm hoping you all can assist me now.
    I have a CCX Script (10.5(1)SU1) that is working beautifully. Within the CAD integration there is a screen pop which sends an ANI value to a corporate application to bring up customer information, this is also working with no issue. I've been given a request from the call center manager to put a task button on the agents' CAD instance to allow them to turn off these screen pops in the event that they need to be on the same screen for longer than the work/wrap-up time between calls.
    My Questions Are These:
    1. I know I can use a task button to set an Enterprise Data value i.e. skip_pop = true (skip_pop being tied to the Boolean value in the script). That being said, I can't change the value until the call reaches the agent and that is too late in the process to stop the prompt from running. Is there a better/different way that I am not thinking off to allow the agent to interact with Boolean value before the call arrives to the agent?
    2. Am I completely off base? Is there a much better way that I can do this in general?
    I am at your mercy and your help is greatly appreciated.
    Thank you
    Justin

    Hey Aaron:
    So I'm in the midst of working through this mess for a button push and I've hit a wall. Perhaps you'll have some insight? In my CDA (see screen shot) I've configured an HTTP action that is in theory sending the agent ID and a value of true.
    In my child script (attached) I have a Get HTTP contact info where I am looking for "Agent_ID" and "sPopState" when I do a test run with a reactive debug I am getting success but the database is basically adding lines but with no information in either column (I have verified that my DB is working correctly).
    Do you by chance have any idea what I might be missing? I'd like to think I'm close but I'm getting into dark territory for my experience level.
    As always, your help and expertise are greatly appreciated.
    Thanks,
    Justin

  • F:selectItems with default boolean value

    Hi!
    I have problem with using tag f:selectItems. I wrote converter in order to connect my items from the ManyChecbox list directly with my objects instead of strings. Now i would like to connect boolean values with my backing bean, so that when the page is rendered the default choice is marked. How can i do this?
    <h:selectManyCheckbox value="#{myBean.selectedItems}"  converter="MyConverter" >
                               <f:selectItems value="#{myBean.allItems}"/>
    </h:selectManyCheckbox>

    well the component is linked to your backing bean property 'myBean.selectedItems', which is probably a list or something. Whatever value in this list is true will be checked, so make the 'default' one true when you initially create the list (for example, in a @PostConstruct annotated method).

  • Sorting a datatable with a boolean value

    Hi all,
    I have a datatable and one of the columns is just a true or false field.
    I'm using the DTOComparator from the BalusC (here: http://balusc.xs4all.nl/srv/dev-jep-dat.html) server but I'm getting the error:
    Error 500: java.lang.RuntimeException: Getter getInclude cannot be invoked.
    It comes from this line of code:
    try {
                c1 = (Comparable) o1.getClass().getMethod(getter, null).invoke(o1, null);
                c2 = (Comparable) o2.getClass().getMethod(getter, null).invoke(o2, null);
            } catch (Exception e) {
                // Obvious. Check if method names are correct.
                throw new RuntimeException("Getter " + getter + " cannot be invoked.");
    Can you not use boolean values with this?
    Thanks for any help!
    Illu

    Instead of a primivive, use a wrapper objects as DTO property which represents a DB entry. Remember, DB2 fields can contain null values.
    So use Boolean instead of boolean. Or just change the comparator to make it compatible with primitives.

  • Query Formula with boolean return values

    Hi,
    In my query, I have a  formula column which returns a boolean value 0 or 1. I need to add these values, but I cannot add them as boolean.  Is there a way that I could convert the boolean values to number/integer so I can add them?
    Thanks in advance
    Best Regards,
    Rose

    Hi Rose,
    please change 'Calaculate Result as' in properties of affected formula to 'Summation'.
    If this sould not help put formula in brackets and multiply by value 1 or create a new formula like
    (yourformula = 0 + yourformula = 1) * 1
    this should provide an integer.
    Regards
    Joe

  • How to use Boolean values from 2 different sources to stop a while loop?

    I am working on a program for homework that states E5.4) Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. Be sure to include the Time Delay Exress Vi so the user has time to press the stop botton. 
    I am doing this right now but it seems as though I can only connect one thing to the stop sign on th while loop. It won't let me connect a comparision of N and the iterations as well as the stop button to the stop sign on the while loop. So how would I be able to structure it so that it stops if it receives a true Boolean value from either of the 2 sources (whichever comes first)? 
    Basically, I cannot wire the output of the comparison of N and iterations as well as the stop button to the stop button on the whlie loop to end it. Is there a solution?
    Thanks!
    Solved!
    Go to Solution.

    Rajster16 wrote:
    Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. 
    Look in the boolean palette for something similar to the word hightlighted in red above.
    LabVIEW Champion . Do more with less code and in less time .

  • Error - '' is not a valid boolean value

    I have been receiving the error message = '' is not a valid Boolean value quite frequently.  It doesn’t matter which hierarchy I am in but it’s typically when I do an Add or Insert.  When selecting ‘ok’ on the error message, I’m able to continue on with my work but was just curious what causes this error.  Sometimes when this error shows up and I click ‘ok’, it will take me out of the DRM screen and into whatever else I may have open at the moment.  Any thoughts or ideas?  We are on version 11.1.1.2.103

    As Murali stated-
    It could be a property incorrectly configured, check all the boolean type properties and see if any of them are getting a string value by any chance.
    Thanks
    Denzz

  • Check box with Boolean data type is not behaving properly

    Hi,
    I create a sample application with one entity driven view object with two attributes. One is of String data type [Value will be Y/N] and another (transient) attribute with Boolean data type. I planned to bind this boolean data type attribute to UI. I overridded the view row impl class and included setting of boolean attribute inside the setter of String attribute. Also in the getter of boolean attribute, added code to check the string attribute and return true/false based on that. Everything is working fine in application module tester. But when i test the same in view controller project in a page, it is not working. Always Check box component is not checked eventhough when i explicitly check it.
    [NOTE: I have given the control hint of Boolean attribute as check_box. Also i don't want selected/unselected entries in the page def file. That's why followed this approach]
    Have i missed out anything? Why this behaviour.
    Thanks in advance.
    Raguraman

    what is the value that is going in when u check it.. did u debug it.. is the viewRowimps setter and getter getting called.. and is it having the right value set and got.. and ur sure that ur using selectBooleanCheckBox..
    ur binding the checkbox to the transient value right??

  • Boolean value mapping in udb

    UDB does not support bit data types to my knowledge... what is a recommended way to map a boolean value to a udb database?

    Hi,
    In my opinon INTEGER (or SMALLINT) with 0 (false) and 1 (true) would be ok.
    And then use "Map the Attribute as Object Type".
    Regards,
    Simon

  • Problem with the Value property node (MacOS)

    As far as I have tested it, Value Property nodes (and Value (signaling)) don't work in MacOS : The value property appears as a boolean, the value(signaling) as a cluster (width, height).
    Even with boolean controls, the node is not working.
    No such problem in LV 8.6.
    Am-I missing something ? Is that some "intended use"  ? Or simply a bug ?
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Solved!
    Go to Solution.

    That sounds like some sort of indexing problem with the property nodes like somesort of corrupted installation.  What if you just delete the property node and recreate it?
    I dropped a numeric control and looked at the shortcut menu for the list of property nodes.  Right below Value and Value (signalling) are Visible (which would be a boolean) and Xcontrol, which when you step down through the submenus, the first choice is Container bounds, a cluster of Width and Height.  So these 2 datatypes that are 2 lower on the list match the ones you are getting.
    What happens if you pick another property node a few elements up or down on the shortcut menu?  Does is happen for some other properties, and if so, are thereany properties that are okay?
    Here is what my property nodes look like for a numeric and I draggged the box up and down to show the natural order of the property nodes.  Note that I have scripting installed, so there are a few more property nodes (and the blue box at the top) that you might not have.
    PS.  Check you signature.  The Kudos button is now moved to the left since the forum upgrade. 
    Attachments:
    Example_VI_BD.png ‏4 KB

  • JSPs using Custom Tag with Boolean attribute cannot compile

    Hi,
    In Oracle9iAS(9.0.3), a jsp using a tag extension, which has a Boolean attribute, caused the following compile error, although the jsp is valid in other web containers.
    ERROR:
    /opt/oracle/j2ee/home/application-deployments/simple/simple/persistence/_pages/_test.java:56: Method toBoolean(java.lang.Boolean) not found in class _test.
    __jsp_taghandler_1.setExists( OracleJspRuntime.toBooleanObject( toBoolean( b)));
    JSP:
    <%@ page language="java" %>
    <%@ page errorPage="error.jsp" %>
    <%@ taglib prefix="jnpr" uri="/WEB-INF/testtag.tld" %>
    <%
    Boolean b = Boolean.valueOf("true");
    %>
    <jnpr:TestTag exists="<%= b%>"/>
    The boolean value is <%= b %>
    Tag Handler:
    package defaultpak;
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.jsp.*;
    public class TestTag extends TagSupport{
    private Boolean exists = null;
    private java.lang.Boolean getExists() {
    return exists;
    public void setExists(java.lang.Boolean newExists) {
    exists = newExists;
    public int doStartTag() throws JspException {
    return super.doStartTag();
    Is this a known problem? Is there a way to get around this?
    Thanks in advance.
    Fred

    This is a known issue with 903, fixed in coming 904.
    In 903 the workaround is to use primitive type "boolean" instead of Object type "java.lang.Boolean" in user's getter and setter code for the taglib.
    -Prasad

  • Calling Stored Procedure with Boolean Output Parameter

    Hi all,
    I'm running into an issue (or is it a BUG) when calling a Database Stored Procedure that has an output parameter of the boolean type.
    procedure proc(p_text in varchar2, p_result out boolean)
    is
    .....I use the following 'standard' code (developer guide 36-19 36-20) to invoke this procedure from my application module.
            try {
                // 1. Define the PL/SQL block for the statement to invoke
                String stmt = "begin proc(?,?); end;";
                // 2. Create the CallableStatement for the PL/SQL block
                st = getDBTransaction().createCallableStatement(stmt, 0);
                // 3. Register the positions and types of the OUT parameters
                st.registerOutParameter(2, Types.BOOLEAN);
                // 4. Set the bind values of the IN parameters
                st.setObject(1, "Some text");
                // 5. Execute the statement
                st.executeUpdate();
                ..............................As soon as 'st.registerOutParameter(2, Types.BOOLEAN);' is invoked I run into a SQLexception. "Invalid ColumnType: 16". Obviously 16 refers to Types.BOOLEAN.
    [edit by Luc]
    SOLUTION / WORKAROUND
    To answer my own question.
    It looks like BOOLEAN output parameters are not supported. I just Read "Appendix D Troubleshooting" of the Oracle® Database JDBC Developer's Guide and Reference 10g Release 2 (10.2).
    I found that JDBC drivers do not support the passing of BOOLEAN parameters to PL/SQL stored procedures. If a PL/SQL procedure contains BOOLEAN values, you can work around the restriction by wrapping the PL/SQL procedure with a second PL/SQL procedure that accepts the argument as an INT and passes it to the first stored procedure. When the second procedure is called, the server performs the conversion from INT to BOOLEAN.
    I'm not very happy with this but I guess I've no choice.
    Regards Luc
    Edited by: lucbors on Nov 30, 2010 10:37 AM

    fyi
    Related to the solution/workaround posted by Luc.
    see "Do Oracle's JDBC drivers support PL/SQL tables/result sets/records/booleans? "
    at http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#34_05
    regards
    Jan Vervecken

Maybe you are looking for

  • Best Practice for ASA Route Monitoring Options?

    We have one pair Cisco ASA 5505 located in different location and there are two point to point links between those two locations, one for primary link (static route w/ low metric) and the other for backup (static route w/ high metric). The tracked op

  • Account name and user folder don't match

    Hi, So I don't know how to change my 'User Folder' name to match my Account name. The name of my user folder, 'sickjestrer4', was the Apple ID I entered when I first registered my Mac. And it became the name of the folder automatically. My account na

  • Problem with Oracle Forums with Opera Browser

    Hello Oracle, i am having trouble navigating and posting thread with Opera Browser version 8.54 The problem is the following: When i enter an Url in the Opera Browser for example: BPEL The page apears ok except for the images that does not appear and

  • Crop in Develop is not showing the change

    In the past, I have been changing my default image size to a 2:3 format by selecting it from the drop down list while in the Develop module or by pressing R. After adjusting the image, it used to display 2:3 under the lock, but now it is going back t

  • Updating Snow Leopard Server Software on Dual Intel Mac Mini

    I have a 2009 Mac Mini Dual Core 2.53 Intel with 4 gb Ram running as a server under 10.6.8 Max OSX Server. But I have never used the server capabilities and don't reallyneed them. The Boss, Wife, wants ITunes radio on it, but it won't work apparently