How to go down the class tree
For example, I want to know what are subclasses of class Animal (here Dog, Cat) ?
class Animal {
class Dog extends Animal{
class Cat extends Animal {
Java reflection has a method to go up the tree getSuperClass(). How can I go down the tree ? If there isn't a method like that, please help me some idea so that I can do it myself.
Thanks a lot
There is no way until the class is loaded anyway. That requires that something has instantiated or referenced it.
You can get part way there by getting things to register themselves somewhere during construction:
public Animal()
CLASS_SET.add(getClass());
}But that's not exactly ideal. In fact, it stinks. My guess is that you're better off designing around this problem so that you don't need to know in the first place.
Hope this helps.
Similar Messages
-
How can I hide the class file ??
Hi !
I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. ThinksSee these....
http://www.saffeine.com/
http://www.jarsafe.com/
I recently read this. This will help you.
http://developer.java.sun.com/developer/qow/archive/160/index.jsp
Enojy....
Rajesh -
My macbook pro is crashing any clues on how to track down the problem?
my macbook pro is crashing any clues on how to track down the problem?
I'm running OS X 10.9.5 on a Late 2008 Macbook Pro... 8GB of memory... I've swapped the original drive for an SSD.
here is a problem report on one of the crashes... they always look just like this:
Mon Oct 6 17:53:40 2014
panic(cpu 0 caller 0xffffff80018dc43e): Kernel trap at 0xffffff7f82fe26e2, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0xffffff80cdde2008, CR3: 0x000000004785e000, CR4: 0x0000000000000660
RAX: 0x0000000000000039, RBX: 0x0000000000000059, RCX: 0x0200000002400009, RDX: 0x7fffffffffffffff
RSP: 0xffffff80fdb8b820, RBP: 0xffffff80fdb8b860, RSI: 0x0000000000000059, RDI: 0xffffff80cdde2008
R8: 0x0000000000000000, R9: 0x0000000000000000, R10: 0xffffff80fdb8b380, R11: 0xffffff7f81efab4c
R12: 0xffffff80cdde2008, R13: 0xffffff802de1d008, R14: 0x0000000000000059, R15: 0xffffff80cdde2008
RFL: 0x0000000000010282, RIP: 0xffffff7f82fe26e2, CS: 0x0000000000000008, SS: 0x0000000000000010
Fault CR2: 0xffffff80cdde2008, Error code: 0x0000000000000000, Fault CPU: 0x0
Backtrace (CPU 0), Frame : Return Address
0xffffff80fdb8b4b0 : 0xffffff8001822f79
0xffffff80fdb8b530 : 0xffffff80018dc43e
0xffffff80fdb8b700 : 0xffffff80018f3976
0xffffff80fdb8b720 : 0xffffff7f82fe26e2
0xffffff80fdb8b860 : 0xffffff7f82fe3cbf
0xffffff80fdb8b970 : 0xffffff7f82fe3ff2
0xffffff80fdb8b9e0 : 0xffffff7f82fe4256
0xffffff80fdb8ba60 : 0xffffff7f82ff53d7
0xffffff80fdb8baa0 : 0xffffff7f82fef706
0xffffff80fdb8bae0 : 0xffffff80019fabd6
0xffffff80fdb8bb10 : 0xffffff80019fb38e
0xffffff80fdb8bb30 : 0xffffff80019de87a
0xffffff80fdb8bc80 : 0xffffff8001b82cc3
0xffffff80fdb8bcd0 : 0xffffff8001b7c076
0xffffff80fdb8bd80 : 0xffffff80019fabd6
0xffffff80fdb8bdb0 : 0xffffff80019fb38e
0xffffff80fdb8bdd0 : 0xffffff80019de87a
0xffffff80fdb8bf20 : 0xffffff80019e602a
0xffffff80fdb8bf50 : 0xffffff8001c40c63
0xffffff80fdb8bfb0 : 0xffffff80018f4176
Kernel Extensions in backtrace:
com.apple.filesystems.afpfs(11.1)[DCC45CDD-E950-364F-8221-1A914106BC59]@0xfffff f7f82fd7000->0xffffff7f83025fff
dependency: com.apple.security.SecureRemotePassword(1.0)[BC0BAB92-C8C9-3959-AA42-272AF578DF D9]@0xffffff7f82fc6000
BSD process name corresponding to current thread: mds
Mac OS version:
13F34
Kernel version:
Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64
Kernel UUID: 9477416E-7BCA-3679-AF97-E1EAAD3DD5A0
Kernel slide: 0x0000000001600000
Kernel text base: 0xffffff8001800000
System model name: MacBookPro5,1 (Mac-F42D86A9)
System uptime in nanoseconds: 13782929543220
last loaded kext at 732159785634: com.apple.filesystems.smbfs 2.0.3 (addr 0xffffff7f83026000, size 335872)
last unloaded kext at 315936860456: com.apple.filesystems.msdosfs 1.9 (addr 0xffffff7f82fb9000, size 57344)
loaded kexts:
tc.tctechnologies.driver.Saffire 8028
com.iospirit.driver.rbiokithelper 1.8.0
com.squirrels.airparrot.framebuffer 3
com.Logitech.Unifying.HID Driver 1.3.1
com.squirrels.driver.AirParrotSpeakers 1.8
com.Logitech.Control Center.HID Driver 3.9.1
com.apple.filesystems.smbfs 2.0.3
com.apple.filesystems.afpfs 11.1
com.apple.nke.asp-tcp 8.0.1
com.apple.driver.AppleHWSensor 1.9.5d0
com.apple.filesystems.autofs 3.0
com.apple.driver.AudioAUUC 1.60
com.apple.iokit.IOUserEthernet 1.0.0d1
com.apple.iokit.IOBluetoothSerialManager 4.2.7f3
com.apple.Dont_Steal_Mac_OS_X 7.0.0
com.apple.driver.AppleUpstreamUserClient 3.5.13
com.apple.driver.AGPM 100.14.34
com.apple.driver.AppleMikeyHIDDriver 124
com.apple.driver.AppleHWAccess 1
com.apple.GeForceTesla 8.2.4
com.apple.driver.AppleHDA 2.6.3f4
com.apple.driver.AppleMikeyDriver 2.6.3f4
com.apple.driver.SMCMotionSensor 3.0.4d1
com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.2.7f3
com.apple.driver.AppleSMCLMU 2.0.4d1
com.apple.driver.AppleMuxControl 3.6.22
com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0
com.apple.driver.AppleLPC 1.7.0
com.apple.driver.AppleMCCSControl 1.2.5
com.apple.driver.AppleUSBTCButtons 240.2
com.apple.driver.AppleUSBTCKeyboard 240.2
com.apple.BootCache 35
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0d1
com.apple.AppleFSCompression.AppleFSCompressionTypeLZVN 1.0.0d1
com.apple.iokit.SCSITaskUserClient 3.6.7
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1
com.apple.driver.XsanFilter 404
com.apple.iokit.IOAHCIBlockStorage 2.6.0
com.apple.driver.AppleUSBHub 683.4.0
com.apple.driver.AppleFWOHCI 5.0.2
com.apple.driver.AirPort.Brcm4331 700.20.22
com.apple.driver.AppleUSBEHCI 660.4.0
com.apple.driver.AppleUSBOHCI 656.4.1
com.apple.nvenet 2.0.21
com.apple.driver.AppleAHCIPort 3.0.5
com.apple.driver.AppleSmartBatteryManager 161.0.0
com.apple.driver.AppleRTC 2.0
com.apple.driver.AppleHPET 1.8
com.apple.driver.AppleACPIButtons 2.0
com.apple.driver.AppleSMBIOS 2.1
com.apple.driver.AppleACPIEC 2.0
com.apple.driver.AppleAPIC 1.7
com.apple.driver.AppleIntelCPUPowerManagementClient 217.92.1
com.apple.security.quarantine 3
com.apple.nke.applicationfirewall 153
com.apple.driver.AppleIntelCPUPowerManagement 217.92.1
com.apple.security.SecureRemotePassword 1.0
com.apple.kext.triggers 1.0
com.apple.iokit.IOSurface 91.1
com.apple.iokit.IOSerialFamily 10.0.7
com.apple.AppleGraphicsDeviceControl 3.6.22
com.apple.nvidia.classic.NVDANV50HalTesla 8.2.4
com.apple.nvidia.classic.NVDAResmanTesla 8.2.4
com.apple.driver.DspFuncLib 2.6.3f4
com.apple.vecLib.kext 1.0.0
com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.2.7f3
com.apple.iokit.IOFireWireIP 2.2.6
com.apple.driver.AppleHDAController 2.6.3f4
com.apple.iokit.IOHDAFamily 2.6.3f4
com.apple.driver.AppleSMBusPCI 1.0.12d1
com.apple.driver.AppleBacklightExpert 1.0.4
com.apple.iokit.IONDRVSupport 2.4.1
com.apple.driver.AppleGraphicsControl 3.6.22
com.apple.iokit.IOAudioFamily 1.9.7fc2
com.apple.kext.OSvKernDSPLib 1.14
com.apple.driver.AppleSMC 3.1.8
com.apple.driver.IOPlatformPluginLegacy 1.0.0
com.apple.driver.IOPlatformPluginFamily 5.7.1d6
com.apple.driver.AppleSMBusController 1.0.12d1
com.apple.iokit.IOGraphicsFamily 2.4.1
com.apple.driver.IOBluetoothHIDDriver 4.2.7f3
com.apple.iokit.IOBluetoothFamily 4.2.7f3
com.apple.driver.AppleUSBMultitouch 240.10
com.apple.iokit.IOUSBHIDDriver 660.4.0
com.apple.driver.AppleUSBMergeNub 650.4.0
com.apple.driver.AppleUSBComposite 656.4.1
com.apple.iokit.IOSCSIMultimediaCommandsDevice 3.6.7
com.apple.iokit.IOBDStorageFamily 1.7
com.apple.iokit.IODVDStorageFamily 1.7.1
com.apple.iokit.IOCDStorageFamily 1.7.1
com.apple.iokit.IOAHCISerialATAPI 2.6.1
com.apple.iokit.IOSCSIArchitectureModelFamily 3.6.7
com.apple.iokit.IOUSBUserClient 660.4.2
com.apple.driver.AppleEFINVRAM 2.0
com.apple.iokit.IOFireWireFamily 4.5.5
com.apple.iokit.IO80211Family 640.36
com.apple.iokit.IOUSBFamily 686.4.1
com.apple.iokit.IONetworkingFamily 3.2
com.apple.driver.NVSMU 2.2.9
com.apple.iokit.IOAHCIFamily 2.6.5
com.apple.driver.AppleEFIRuntime 2.0
com.apple.iokit.IOHIDFamily 2.0.0
com.apple.iokit.IOSMBusFamily 1.1
com.apple.security.TMSafetyNet 7
com.apple.security.sandbox 278.11.1
com.apple.kext.AppleMatch 1.0.0d1
com.apple.iokit.IOReportFamily 23
com.apple.driver.DiskImages 371.1
com.apple.iokit.IOStorageFamily 1.9
com.apple.driver.AppleKeyStore 2
com.apple.driver.AppleFDEKeyStore 28.30
com.apple.driver.AppleACPIPlatform 2.0
com.apple.iokit.IOPCIFamily 2.9
com.apple.iokit.IOACPIFamily 1.4
com.apple.kec.pthread 1
com.apple.kec.corecrypto 1.0
Model: MacBookPro5,1, BootROM MBP51.007E.B06, 2 processors, Intel Core 2 Duo, 2.66 GHz, 8 GB, SMC 1.41f2
Graphics: NVIDIA GeForce 9400M, NVIDIA GeForce 9400M, PCI, 256 MB
Graphics: NVIDIA GeForce 9600M GT, NVIDIA GeForce 9600M GT, PCIe, 512 MB
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1067 MHz, 0x85F7, 0x483634353155373946373036364700000000
Memory Module: BANK 0/DIMM1, 4 GB, DDR3, 1067 MHz, 0x85F7, 0x483634353155373946373036364700000000
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8D), Broadcom BCM43xx 1.0 (5.106.98.100.22)
Bluetooth: Version 4.2.7f3 14616, 3 services, 23 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: OWC Mercury Electra 3G SSD, 480.1 GB
Serial ATA Device: HL-DT-ST DVDRW GS21N
USB Device: USB2.0 Hub
USB Device: Built-in iSight
USB Device: BRCM2046 Hub
USB Device: Bluetooth USB Host Controller
USB Device: IR Receiver
USB Device: Apple Internal Keyboard / Trackpad
USB Device: USB Receiver
Thunderbolt Bus:These may be your problem candidates:
Uninstall them and then reinstall in a systematic manner and see if the MBP crashes again. If and when it does, then that is the troublemaker.
Ciao. -
How can you slow down a voicemail you are listening to? Someone sent me a voicemail and they spoke way too fast for me to understand them. I want to know how to slow down the voicemail so I can understand them if that is possible.
I have to say, this is so weird because it's actually become this way in the past week maybe, and I'm sure me saying this here will be disputed, ridiculed and belittled, and that's absolutely fair, but I've got to say it... up until a few days ago, my iTunes sync/backup area really would keep more than one backup for my one, single iPhone. They were all timed and dated with a drop-down menu (which appeared if I clicked the restore button) to choose which one I wanted to roll back to, for example. Sure, I'd read about the three backups thing etc. etc. and perhaps I got that wrong or misunderstood, but I can honestly say, I only ever had at the most two backups, that I could drop-down and choose to restore from. They were there. Same iPhone. Different dates.
At the time, when this seemed to be the case, the backing-up process took quite a while. I would leave it to progress while I went and made a cup of tea, come back and it still wasn't finished running. So, not really AGES, but a little while.
Now, when I perform a backup, the progress bar almost shoots across to a finish. I'll 'fess up... that worries me most of all. I can live without the luxury of a menu of backups... but if it does it once, I'd like to be sure it does it at all.
Much more importantly though, thank you for your replies so far.
Any further input, even if it's to belittle or shame is totally welcome. I'd like to understand this a bit more.
Thanks again. -
How to access all the classes in a jar file
hai
i have a custom built JAR file which has many classes(Translets) in it . i want to access the classes inthe JAR file in a JSP page or an servlet. I have tried setting the classpaths etc , but nothing has happened.
Where should the jar file be Palced - i am using Tomcat Server.
How Can i Access the class files .. Very Urgent .. Please Help me ..
Peter IyerWhat is showing a file not found error? The web browser? if so, that's probably not a problem with the jar file.
Also, have you expanded your jar file to make sure that you jarred it up correctly? -
HT1533 how to put down the volume during the imac startup
how to put down the volume of startup sound of imac
Google mute startup sound mac and peruse the results.
-
B520 - how to bring down the monitor contrast?
Brightness control in the front panel are not enough.
the backlight is too much for me to handle
Does anyone know how to bring down the contrast even more?
thank you.I'll clear this up a little...
NVIDIA Controls does not have any control over the lamp / backlight on the screen. You can turn down
the gamma / brightness / contrast, and you may think you see it darker.
YEEEEEEES. it's dark but the intensity of the backlight is still there. You can feel it from miles away.
I chose Lenovo over ASUS just because of the GT555 option, and it was the worst mistake ever.
Asus Et2700 series do have Contrast/Brightness controls for the screen in Values from 0-100.
You can turn the screen completely dark if you want. Asus have never let me down, but thanks to my greed
always wanting more, thought i would never feel complete unless i had the gt555.
This is what happens when you fall for the marketing agenda.
Fortunately, i sold it already. And this would be the last time i'll purchase something from lenovo.
I'd like to think this is something that they just never thought. WRONG!!!. They know. they do it on purpose.
That's their way to make you feel incomplete, so you can start chasing for something else and fall again
in the marketing agenda.
There's always a way to make an "ALMOST PERFECT" product, the worst nightmare for you.
they have done this for years, since the beginning of times.
Let's not forget about the SATA performance issue in H67/P67 chipsets:
http://www.pcstats.com/articleview.cfm?articleID=2589
the B520 is one of the lines affected and lenovo did nothing about it.
And please let's not forget about the Trojan that got infiltrated in the drivers disc
for the B Series Line.
Hopefully, your campany will get a FORMAT C: by the end of this year.
arrivederci. -
How can tear down the growing barriers to education using iphone?
Recently, I have had a growing feeling that the avialability, meaningfulness, and ease of use of educational app on the iphone has gotten worse not better. In fact it feels like there are a growing number of specific barriers to education using the iphone. I would like to discuss one specific "barrier" to education--avialability in your country's app store by using a specific example--Einstien Pedometer App.
Back in 2011, the Einstien pedometer App by Kami was all the rage. Even popular science a noneducation maganize noted this innovation-- http://www.popsci.com/technology/article/2011-04/new-ipod-app-calculates-how-spe cial-relativity-affects-your-daily-activities . However, now you cannot get this app unless your are in china as you can see from the orginal link:
http://itunes.apple.com/us/app/einsteins-pedometer/id427443192?mt=8
So I ask you all for help in tear down this barrier and tearing down this wall...
How can we tear down this barrier of country availability?
Is there a way to contact the orginal company like Kami?
Is there a way to change your country and install it? Is this safe for students to do?
Should I contact tech support?
This app like other by Vogt and Kuhn are important ones to me that I have found unavialable in the United States. Measuring Relativity not just calculating it is important for the iphone future, because phones are currently one of the few mainstream devices to have a guarunteed across the board GPS chip! Thus, unlike the innovations of Vogt and Kuhn, the Einstien Pedometer is a physics application that is only available using ones smartphone.
This is my tech support submission, which better explains why I felt this was a barrier:
What happened to the Einstien Pedometer App?
Back in 2011 there was a famous Einstien's Pedometer App by Kami. Recently as of February 2014, I found out that this app was unavailable on the App Store due to "unavailable in the United States". The android already has a similar app called "Proper Time" by N. Thinsell. I wanted to include this app as part of my physics smart phone laboratory series. Specifically, I have worked painstakingly to develop a lab so that students could measure special relativity time dilation using their smart phones GPS chip. (The lab is similar to the work of P Vogt and J Kuhn which is different from many of gimmick apps, which are only ebooks of text, not actual physics measuring devices.) The current unavailability of this app is simply another barrier to using iphones for education. This is why I am very disappointed right now. Incorporating Android systems into physics high school curriculum is easy; however, I have tried many times to try to incorporate apple products into the physics curriculum to no avail. It feels like with each successful year there are more and more barriers to using iphones for application-level understanding in physics education.
Message was edited by: lanebell who finished adding the rest of there commentsDah Veed,
How? No really how do I contact the app developer from a foreign country?
Going back to my example, so far I was able to figure out alot of things about the app developer of the Einstien Pedometer app--except there contact information. Besides prehaps seeking apples supports help in contacting the developer, do you have any other suggestions?
Information that I know so far:
App: Einstein's pedometer
Developer's Name: Mitsuru kamiyama
Language: Japanese
AppStore Page: https://itunes.apple.com/us/artist/kami/id362020177?mt=8
Developers really old website: http://playoffline.ddo.jp/app/
P.S. While it didn't exactly solve the problem, your reply was very helpful, so I thank you for your reply. -
First i know that when i make any changes to the class library project i need to rebuild the project then to remove the Capture.dll from the TestScreenshot project and then to add again the updated Capture.dll
The problem for example in this case i'm trying to use a public static variable i add in the DXHookD3D9.
In the DXHookD3D9 i added this public static variable:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using SlimDX.Direct3D9;
using EasyHook;
using System.Runtime.InteropServices;
using System.IO;
using System.Threading;
using System.Drawing;
using Capture.Interface;
using SharpDX.Direct3D9;
namespace Capture.Hook
internal class DXHookD3D9: BaseDXHook
public DXHookD3D9(CaptureInterface ssInterface)
: base(ssInterface)
LocalHook Direct3DDevice_EndSceneHook = null;
LocalHook Direct3DDevice_ResetHook = null;
LocalHook Direct3DDevice_PresentHook = null;
LocalHook Direct3DDeviceEx_PresentExHook = null;
object _lockRenderTarget = new object();
Surface _renderTarget;
public static decimal framesperhourtodisplay = 0;
protected override string HookName
get
return "DXHookD3D9";
List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>(
framesperhourtodisplay
The problem is i can't even get to the Capture.Hook namespace and not to the DXHookD3D9 from the TestScreenshot application window project.
This is a screenshot:
For example fro the FramesPerSecond class i can use it get to it from the windows forms application.
namespace Capture.Hook
/// <summary>
/// Used to determine the FPS
/// </summary>
public class FramesPerSecond
int _frames = 0;
int _lastTickCount = 0;
float _lastFrameRate = 0;
Since it's public i guess.
But if i will change the DXHookD3D9 class from internal to public:
public class DXHookD3D9: BaseDXHook
I will get error on the DXHookD3D9:
Error 1
Inconsistent accessibility: base class 'Capture.Hook.BaseDXHook' is less accessible than class 'Capture.Hook.DXHookD3D9'
And the BaseDXHook class:
namespace Capture.Hook
internal abstract class BaseDXHook: IDXHook
protected readonly ClientCaptureInterfaceEventProxy InterfaceEventProxy = new ClientCaptureInterfaceEventProxy();
public BaseDXHook(CaptureInterface ssInterface)
this.Interface = ssInterface;
this.Timer = new Stopwatch();
this.Timer.Start();
this.FPS = new FramesPerSecond();
Interface.ScreenshotRequested += InterfaceEventProxy.ScreenshotRequestedProxyHandler;
Interface.DisplayText += InterfaceEventProxy.DisplayTextProxyHandler;
InterfaceEventProxy.ScreenshotRequested += new ScreenshotRequestedEvent(InterfaceEventProxy_ScreenshotRequested);
InterfaceEventProxy.DisplayText += new DisplayTextEvent(InterfaceEventProxy_DisplayText);
~BaseDXHook()
Dispose(false);
How can i solve it so i can use the variable framesperhourtodisplay in the DXHookD3D9 class with the TestScreenshot windows forms application ?Hi,
I dont know if it will work here, since I dont know the complete structure, but the base call must be public, if the derived class is public, so the base class is at least as accessible as the derived class.
Try make the base class public. (And maybe the base-class IDXHook of the base also...)
Or use a different approach and make only the properties public that are needed to be public by adding an extra class...
A structure could look like:(you need to create a class thats public in your dll and expose a property, and set this property in the internal class...)
In the Accessing class (here Form1)
public partial class Form1 : Form
public Form1()
InitializeComponent();
private void Form1_Load(object sender, EventArgs e)
C c = new C();
MessageBox.Show(B.F.ToString());
and in the class Lib:
internal class A
public A()
B.F = DateTime.Now.Millisecond;
public class B
public static int F { get; set; }
public class C
public C()
A a = new A();
(add a referenc to the class lib from the accessing project)
Regards,
Thorsten -
How can i write the DOM tree to the XML File?
Asslamo ala mn etb3a Alhoda.
My problem priefly is that i can't write the DOM tree to XML file.
I write following code to give the user the ability to input the name of data base which he want to create.
If i wrote DB name,its atrributes and its values succefully to XML file ,then i'll read it succefully to RAM.
It'll be simple DBMS.
***My code***
import javax.swing.*;
import javax.xml.parsers.*;
import org.w3c.dom.Document;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
public class Main {
* @param args
public static void main(String[] args) {
// TODO Auto-generated method stub
String DBname;
DBname=JOptionPane.showInputDialog("Enter Your Data Base Name");
OPerations O=new OPerations();
O.creatDB(DBname);
class OPerations {
public void creatDB(String name){
//get an empty Document
DocumentBuilderFactory f; f=DocumentBuilderFactory.newInstance();
try {
builder = f.newDocumentBuilder();
Document doc= builder.newDocument();
//Build tree DOM With the root Node
Element root=doc.createElement(name);
//add the root element to thevdocument
doc.appendChild(root);
catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}Do an identity transformation to output it:TransformerFactory tf = TransformerFactory.newInstance();
Transformer tr = tf.newTransformer();
tr.transform(new DOMSource(doc), new StreamResult(new FileOutputStream(new File(filename))));(typed without syntax check) -
How to load all the classes in a JAR file at runtime?
Any clues o:
"How can I force JVM to load all the classes in a specified JAR at once?"
Thanx!
-RajeevWell I was thinking may be there exists an option with "java", when I
am starting an application from a jar file, I could force it to load all
the classes in the JAR. I don't want to do it programically. Is there such
an option available?? Or in other words can I ask JVM to not do the dynamic
loading for the JAR??
Thanx.
List all JarEntries and convert the paths to fully
qualified class files
e.g file in jar
[1] /com/mycompany/proj/X.class
should become
[2] com.mycompany.proj.X
then for each entry issue
Class.forName( [2] ); -
How to i get the class name ? please help me
hi friends
i want to know how to get the class name from my java program
public class sample
public static void main(String args[])
how to i get sample.
please help me.
thanks in advanceI can't recall which forum member gave the following solution, but it works
in static contexts and it's copy-and-paste friendly -- you don't hard-code the
name of the class, only a dummy class that you use to make this hack work:
public class Foo {
private static class Dummy{}
public static void main(String[] args) {
Class cls = Dummy.class.getEnclosingClass();
String name = cls.getName();
System.out.println(name);
} -
CRVS2010 Beta - How do you hide the Group Tree for Visual Studio 2010
Would anyone know how to hide the group tree in the Crystal Reports viewer for Visual Studio 2010. I have tried
DisplayGroupTree="False" and found the property doesn't exist in the new version for VS 2010. I have search in the designer options and found nothing. Note this report is for ASP.net.
Thanks
Dave.
Subject modified as per the sticky post at the top of this forum; [Crystal Reports for Visual Studio 2010 Beta - read before posting|Crystal Reports for Visual Studio 2010 Beta - read before posting;
Edited by: Ludek Uher on Sep 15, 2010 8:55 AMA simple search using the search box in the top right corner of this web page would have come up with the following KBase as one of the 1st - if not the 1st hit (for once, we beat Google ).
[1183704 - How to display or hide the Group Tree in CrystalReportViewer control through code in Crystal Reports 2008|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333133383333333733303334%7D.do]
- Ludek -
How to exit from the class execution process?
I am invoking an exe from my Java application using the Runtime.getRuntime().exec() method.
though the process is completed, the class is still running.
how do i exit from the class execution, but with the process still running??To sabre150 :
I am directly executing the command through the exec() method:
Runtime.getRuntime().exec("...../iexplore.exe");This way, the control is going to the opened IE window and only on closing it, my class is exiting.
Is there any other way where I can come out of the class, but ensure that the process which i run through the exec() method, is still running? -
Af:tree - how do I highlight the selected tree node?
af:tree
I checked the generated CSS file. I found that when a tree node is selected, the related CSS attribute is:
.xj:link{
font-family:Arial,Helvetica,Geneva,sans-serif;
font-size:10pt;
font-weight:normal;
color:#663300
I created a customized CSS attribute, but then all of the links have the customized CSS attributes.
How do I just highlight the selected tree node link?
Thanks,
--Toddtry doing the onclick javascript method
you have to place it on the node element and id must be made dynamic
for this use 'this.id'
by which the current id of the node is passed
and by capturing the id name in a var
use the same for invoking its selected property and make it true
like this
var currentid = this.id;
this.form.currentid.selected = true;
Maybe you are looking for
-
Mail, App Store, Quicktime and others don't work!
I downloaded OS X Mavericks but mail crashes every time i open it with my IMac. Also App Store, Quicktime and other software don't work. I'm really in difficult! Help me please!
-
Can I use my phone number in imessage for both iphone and ipad in the same chats?
I want to use iMessage from my ipad with my phone number not with my e-mail because most of my friends have not my e-mail under my name in their phones. So what I want to is being able to talk in the same chat from my ipad and iphone with out showing
-
1st generation iPod making computer shut down since Tiger
Dear Gang, I need some help. Since upgrading to Tiger, my 1st generation iPod now makes my PowerMac G5 shut down the second I put it in the firewire port on the front of the computer. Anyone else had this problem? Any advice? TIA, Mark
-
Is it possible to change the Google Search Field within a Safari browser to be specific to the country you live in? Eg. I want mine to be a Google AU search field as opposed to just Google. Thanks.
-
I get and error message when going into D:/setup I get D:/setup.exe is not a valid Win32 application. I then tried the Install folder/Win32/Setup and got another error msg. Java Runtime Environment not found. I have downloaded this as requested, rebo