Traverse object tree from the middle with reflection

Hi.
I am new to using reflection in more complex scenarios, and would like some advice.
If I get back a partial object tree, from an ORM layer for example, where I have a series of associated objects, for example Employee, which has a Department attribute, linking it to its parent department, and a collection of child address objects, is it possible to traverse all objects attached to Employee, calling a given method on them, if they extend a certain class?
Could someone show an example of doing this, or describe how it could be done?
Thanks for your help.

You have an arbritrarily complex hierarchial collection whith a unknown structure.
You wish to apply a method to all references in the tree.
There are only two basic storage mechanisms in java; reference or array.
Setup: Keep a hashtable/dictionary of each visited reference to avoid endless recursion.
Method, called Doit() which takes an Object 'n'
- If n is null return
- if n is already in hashtable return
- Add to hashtable
- if n is of type base class then call target method (might want to decide about thrown exception.)
- reflect through n for members which are either Object or array (base type Object)
- If single member is Object then call Doit
- If array recurse through each item and call Doit()

Similar Messages

  • I am missing the add objects section from the fly out menu in Photoshop CS6. 3d workspace

    I am missing the "add objects" section from the fly out menu in Photoshop CS6. I am in the 3D workspace of Photoshop. "Scene" is highlighted and I have clicked on the little fly out menu in the upper right hand corner of that panel. The whole section that should contain, Add objects, delete objects, duplicate objects, all the way through reverse order is missing. The add lights section above and render section below it is there. I am not new to Photoshop, but I am new to the 3D section of Photoshops work space.
    I do know about creating a new layer in the layers tab and merging the objects together trick. But I kind of would like for the program to work correctly as I am sure that doing it that way will cause some sort of problems later in the work process.
    Below are the specs of my system.
    Adobe Photoshop Version: 13.0.1 (13.0.1.3 20131024.r.34 2013/10/24:21:00:00) x64
    Operating System: Windows NT
    Version: 6.2
    System architecture: Intel CPU Family:6, Model:12, Stepping:3 with MMX, SSE Integer, SSE FP, SSE2, SSE3, SSE4.1, SSE4.2, HyperThreading
    Physical processor count: 4
    Logical processor count: 8
    Processor speed: 2394 MHz
    Built-in memory: 32651 MB
    Free memory: 28832 MB
    Memory available to Photoshop: 29606 MB
    Memory used by Photoshop: 89 %
    Image tile size: 128K
    Image cache levels: 4
    OpenGL Drawing: Enabled.
    OpenGL Drawing Mode: Basic
    OpenGL Allow Normal Mode: True.
    OpenGL Allow Advanced Mode: True.
    OpenGL Allow Old GPUs: Not Detected.
    Video Card Vendor: Intel
    Video Card Renderer: Intel(R) HD Graphics 4600
    Display: 3
    I am actually running windows 8. So I am not sure why it is saying windows NT. Anyway...
    Photoshop says that my software is up to date. I use Photoshop daily and everything else works just fine. I have looked through this forum and there is someone else who had the same issue as me but their question was not given a solution. So that is why I choose to post it again.
    Any help will be great. Thank you!
    Mark.

    I've made tests with four different 3rd party tools: OpenGL Extension Viewer, GPU Caps Viewer, Compute4Cash OpenCL Diagnostic Tool and Mudlord's Glide3x wrapper tester. All those tools report no problems with my video card driver and OpenGL/CL.
    I have contacted nVidia and based on reports from the tools and visual tests from GPU Caps Viewer nVidia support doesn't see a problem with my driver.
    I found sniffer_gpu.exe which according to Adobe Help pages is a kind of diagnostic tool and determines whether Photoshop uses the graphic card OpenCL or not. Here is the output:
    Device: 00000000002B1BE8 has video RAM(MB): 1023
    Vendor string:    NVIDIA Corporation
    Renderer string:  GeForce GTX 650/PCIe/SSE2
    Version string:   3.0.0
    OpenGL version as determined by Extensionator...
    OpenGL Version 3.0
    Has NPOT support: TRUE
    Has Framebuffer Object Extension support: TRUE
    OpenGL ok
    OpenCL ok, version=1.1 CUDA 4.2.1
    Return code: 3
    From Adobe GPU Sniffer tool, it looks OK.
    On the other hand, I have your word that there is no problem with Photoshop not recognizing OpenCL for my card and that nVidia driver has problems. Can you justify this somehow? Perhaps you could provide more details on technical level, or another utility to run and extract details, to at least identify the problem Photoshop has and hopefully solve it on either side.
    P.S. During tests there were two things which I noticed, but they are probably not related to the issue:
    1. One tool reports the lack of Windows registry key SOFTWARE/Microsoft/Windows (NT)/CurrentVersion/OpenGLDrivers. But according to your previous statement, Photoshop only uses OS calls, no registry and according to nVidia, this key is not used in Windows 7.
    2. During some tests GPU Caps Viewer reports that "OpenCL CPU not supported on the selected platform". This is not complaining about GPU, only about CPU. But Photoshop is complaining about GPU, so it shouldn't be relevant.

  • Resizing a box from the middle

    Hi
    I've got a bit lost in the timeline with a simple command between two states here, can anyone help?
    I've got a rectangle that needs to resize from 0px w 26px h in the centre of the page in the first state to 800px w 26px h and fade in in the second state. I can deal with the fade in OK it's the resize that's confusing me as it seems to want to resize from the left of the rectangle and not its centre point.
    Can I resize from a centre point of the rectangle outwards as in Fig.2 between 2 states?
    Thanks

    As usual given time you solve it yourself.
    I was just getting mixed up with Resize and Move as they both need an equal value for it to stretch from the middle. If you don't add any value in the timeline to Move it stretches from the left hand side of the rectangle.

  • What is the best way to remove footage from the middle of a clip?

    What is the best way to remove unwanted footage from the middle of a clip? I have a clip that I've trimmed from the start and finsih, but I need to remove "boring" footage from inbetween.

    Thank you for your replies. I tried the blade tool followed by select and delete but it did not seem very precise. I had better success with this aproach at the ends rather than in the middle. I watched a tutorial video on using the precision editor, but the video was small so I had a difficult time following where the person clicked, etc. Any info on using the precision editor would be greatly appreciated. I need to make precise cuts to avoid creating unatural motion for the subject. So far, close but no cigar.
    Regards,
    Michael

  • I bought my 6 plus last night decided to upgrade the IOS 8 like they suggest and now all I see is a white screen with the apple sign in the middle with an occasional flashing red screen. Did my new phone seriously just crash? What do I do now?

    I bought my 6 plus last night decided to upgrade the IOS 8 like they suggest and now all I see is a white screen with the apple sign in the middle with an occasional flashing red screen. Did my new phone seriously just crash? What do I do now? I left it overnight with the white screen, thinking maybe it'll go away and needs time to upgrade. Woke up this morning, nope still white screen. Very disappointed with Apple. I was so excited to get my phone and can't even use it right now.

    First turn the iPhone off and back on and see if it works.  If that doesn't work then do a Reset by holding the Sleep / Wake Button (The Power Button) and the Home Button at the same time until the white Apple Logo appears, the release both Buttons and wait until a Full Reset occurs.  The iPhone 6 should come back to your Lock-Screen.  If that doesn't work then you could connect the iPhone 6 via the Lightning Cable to a Computer with a Current Version of iTunes.  Then open iTunes on the Computer and wait until your see a Button that represents your attached iPhone and click on it.  This should bring up a Summary Screen on the Computer within iTunes.  At that point your can choose Update Software if an Update is available or Restore the iPhone to Factory Settings / New In The Box, or you could try to Restore from your Backup if a current Backup had already been saved from a previous iPhone.
    If you don't have a computer with iTunes and you can get the iPhone back on, then go to Settings>General>Software Update and see if the iPhone is still on iOS 8.0 or if it is now on iOS 8.0.2

  • Delete music from the cloud with ipod touch

    how do  I delete songs from the cloud with ipod touch

    What do you mean delete from iCloud?
    If you only want songs downloaded to the iPod to show on the iPod go to Settings>iTunes and App Store and turn off Show all.

  • Help. Need to remove one of the listed QuickTimes from the "open with" menu

    When I bring up the 'Open with' menu on an audio file I have QuickTime Player (7.3.1) and just below that I have QuickTime Player (7.2.1). I would like to remove the 7.2.1 listing from this menu. There is on one version on my computer (7.3.1). The last update must have placed the newer listing in this menu and left the older listing. Is there a way to remove the older listing from the open with menu?

    Did you ever do an archival and install of your OS? If so, you have what is called previous system fold on your main hard drive. This is where you can find the player to the version. If not I guess what happen to you is strange...mmm... And I guess it could happen.

  • HT1212 Is my screen supposed to change from the screen with the charger and the iTunes circle to my lock screen while it's in recovery mode?

    Is my screen supposed to change from the screen with the charger and the iTunes circle to my lock screen while it's in recovery mode?

    Is Find My Phone turned on, on your phone? If so, eject from iTunes, login to iCloud.com, locate your phone, then erase it.
    Does the same thing...removes the passcode. Then, either restore from backup, or setup as a new device.

  • HT201335 when i watch movies from the web with airplay on my apple tv stop every 2 minuts

    when i watch movies from the web with airplay on my apple tv stop every 2 minuts

    I have a similar issue with my Home Sharing.  Everything plays just fine on my Apple TV except when I try to play a movie using Home Sharing.  If I choose the same show or movie from the Purchased section of iTunes it works just fine but nothing ever loads for me on Home Sharing.
    Not the exact same issue, but very similar.  Good luck, I'm hoping to learn something here too!

  • Detect attack man in the middle with IDS/IPS

    Hi,
    I have aip-ssm 20, IPS Version 7.0(6)E4
    The ID  signature 7101, 7102, 7104 and 7105 is used for detecting attack arp poison.
    The sensor works as IDS in promiscuous mode. All traffic is fordwared to sensor.
    I have made attack man in the middle with cain & abel but sensor doesn't send alarm. I attach image with signatures.
    Why don't sensor detect attack? The network is in zone inside.
    Can anybody help me, please?

    Did you check if SSM is getting those packets by running "packet display .." command on the sensing interface. In SSM the ARP packets would not be forwarded by ASA to the SSM.
    thx
    Madhu

  • Fm or metod that retrieve the lock object name from the table name

    HI ALL,
    there is FM or method that retrieve the lock object name from the table name ?
    Best regards
    Nina

    CALL FUNCTION 'ENQUEUE_REPORT'            
    EXPORTING                                
    gclient                     = sy-mandt   
    gname                       = 'RCTMV'         "Table Name
      GTARG                       = ' '       
      GUNAME                      = SY-UNAME  
    IMPORTING                                 
      number                      =           
      SUBRC                       =           
      TABLES                                  
        enq                         =  lt_seqg3
    EXCEPTIONS                               
       communication_failure       = 1        
       system_failure              = 2        
       OTHERS                      = 3

  • HT2375 Hi I can't play back track from the middle of a software track

    Hi I can't play back track from the middle of a software track, and hear what I have played.

    MarsDaretoDream wrote:
    Hi I can't play back track from the middle of a software track, and hear what I have played.
    For this you need to look at chase functions.  Project settings>Midi>Chase button

  • Installing oracle application express from the database with oracle 11g

    Hi,
    I installed oracle 11g release 1 and trying to install oracle APEX from the database with Embedded PL/SQL gateway. The installation guide require grant connect privilege to any host for the APEX_030200 database user, but this schema does not exist in the database...
    How to continue the installation of APEX ?

    Thanks Hari,
    But I need to enable network services in my database (oracle 11g).
    Do I have to replace in the PL/SQL script below apex_030200 by flows_030000 ?
    DECLARE
    ACL_PATH VARCHAR2(4000);
    ACL_ID RAW(16);
    BEGIN
    -- Look for the ACL currently assigned to '*' and give APEX_030200
    -- the "connect" privilege if APEX_030200 does not have the privilege yet.
    SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
    WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
    -- Before checking the privilege, ensure that the ACL is valid
    -- (for example, does not contain stale references to dropped users).
    -- If it does, the following exception will be raised:
    -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_030200'
    -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
    SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
    FROM XDB.XDB$ACL A, PATH_VIEW P
    WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
    EQUALS_PATH(P.RES, ACL_PATH) = 1;
    DBMS_XDBZ.ValidateACL(ACL_ID);
    IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_030200', 'connect') IS NULL THEN
    DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,'APEX_030200', TRUE, 'connect');
    END IF;
    EXCEPTION
    -- When no ACL has been assigned to '*'.
    WHEN NO_DATA_FOUND THEN
    DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml','ACL that lets power users to connect to everywhere',
    'APEX_030200', TRUE, 'connect');
    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
    END;
    COMMIT;
    Regards

  • Help. Need to remove item from the "open with" menu

    Does anyone know how I can remove an item from the "open with" menu?

    You could try removing the quicktime .pkg files from the receipts folder in the root library.
    The system has to go somewhere to determine eligible applications it can use to open a file.
    Each application would contain its base settings in its receipts file.
    Once you delete the receipt you should delete the application and reinstall it.
    The reinstall will write a new receipts file.
    The receipts file is used by your system when it repairs disk permissions.
    The system does not just add a setting.
    For example if you take a .png file and click on it and look at what can open it you may get a long list.
    If you choose "other" from the get info "open with" menu and have acrobat reader installed in applications, it will show as an application you can choose.
    That application, however, is not in the drop down list.
    If you choose acrobat reader and apply it to the file type, it will show as the default.
    If you then choose another application in the list and apply, Acrobat Reader disappears from the list.
    The system only shows files in the list that advertise to the system that they can read the file type.
    You have a system which is populating the list with legitimate programs that are compatible with the advertised file type.
    It is reading that advertisement for the quicktime application somewhere.
    The configuration is written to each file individually, you can choose to have a single file associated with a particular application or have it apply to all files of that type.
    Check in Spotlight for a copy of the application in another location.

  • Remove applications from the "open with" menu

    How do you remove applications from the "open with" context menu? I seem to have one instance of a program for every time it was "updated." So my "open with" menu has about 8 instances of Adobe Acrobat, 3 or 4 of Word, etc. It's obnoxious and cumbersom. Any idea how to edit this context menu? Thanks.

    hi joshua,
    you can solve it in two ways:
    1)open terminal and copy and paste:
    /System/Library/Frameworks/ApplicationServices.framework/\
    Frameworks/LaunchServices.framework/Support/lsregister \
    -kill -r -domain local -domain system -domain user
    enter and wait the prompt
    2) delete this files and restart
    library/caches/com.apple.LaunchServices-xxxxx.csstore
    (more than one files with the xxxx i mean number)
    ~/library/preferences/com.apple.launchservices.plist

Maybe you are looking for

  • Error during Component Deployment Validation

    Windows 2008 SP2 64-bit server running JBoss and LiveCycle ES2 SP1 after installing SP2, running the Configuration Manager, I get the following error in the LiveCycle Component Deployment Validation stage: adobe-usermanager-dsc.jar is deployed but is

  • Master-details query to XML file?

    Hi: I'm new in XML and Oracle. I want to create XML file from two tables (master-details). I made a small serach and tried some examples: Say we have these tables: CREATE TABLE "TEST_XML" (     "ID" NUMBER,      "NAME" VARCHAR2(15),      "AMOUNT" NUM

  • Stage.nativeWindow.alwaysInFront how to keep the window always in front

    Hi, I've just written and application that needs to always be in front of the other applications. I have set the application's nativeWindow.alwaysInFront property to true, but, after a few other air applications open the application will get pushed b

  • SLA reporting in SCOM - can I sort Health from Computer?

    Hi, I am trying to do what others have done before in creating an SLA report from SCOM. I am going down the route of using the Health Service Agent watcher as what I am going to report on rather than Windows computer etc. My first problem was just re

  • Unregister EAS from Shared Services

    Hi Together, I've a problem that an installation over an existing installation (same version) registered my eas to shared services what I don't want to have. I red in the documentation of EAS that the backwords way isn't possible. Somebody got a tric