I jave a simple Java bean with 4 attributes, getter/setter, and some overided methods like toString, equals and hashCode.
Above every Attribute is a custom Annotation:
import java.lang.annotation.*;
import java.lang.annotation.RetentionPolicy;
@Target(ElementType.FIELD)
@Retention( RetentionPolicy.RUNTIME )
public @interface DAOProper...
hi all
how can i get list of all available classes in classpath at runtime?!
as i know in eclipse IDE by pressing crtl+shift+T it is possible to do such thing
is there any method in java to get it done?
thanks in advance
...
I'm new to C# and would like to ask for some direction on solving the following problem.
I've got a xml file used as a template (without knowing its content in advance). something like:
<Object>
<Property name="ID">
<Value weight="40">10000</Value>
<Value weight="60">20000</Value>
</Property>
<Property name="Name">
<V...
Hi
I got stuck up while dynamically assigning methods to a delegate instance through reflection. Below is a sample scenario of the situation i am faced with.
class Program
{
static void Main(string[] args)
{
new DynamicDelegateTest().Test();
}
}
public class DynamicDelegateTest
{
public void Test()
...
I'm writing a logging framework and need to serialize each object in an IDictionary<string,object>. Object can be a simple string, int etc. or a complex business object or a collection of either. Therefore I need a flexible method for doing this.
At the more complex end of things I'd like the output to be something like:
Object = IList...
i'm writing an F# dsl for SQL (http://github.com/kolosy/furious). A select statement would look like this:
type person = {
personId: string
firstname: string
lastname: string
homeAddress: address
workAddress: address
altAddresses: address seq
}
and address = {
addressId: string
street1: string
zip: st...
Hello,
I have a class TableData with two magic methods. One is the constructor and the other is the __call method.
I have realized the invoke with following code:
$class = new ReflectionClass('TableData');
$class->newInstanceArgs($parArray);
It work great. But now I want to use my magic method. So I call $class->getData(), but it do...
I want to set the value of a private field using reflection for unit testing.
Problem is, that field is static.
Here's what I'm working from:
/**
* Use to set the value of a field you don't have access to, using reflection, for unit testing.
*
* Returns true/false for success/failure.
*
* @param p_instance an object t...
I think Title is not very suggestive in what I meant to ask, so theres is an example.
I have this method that receives a name of System.Windows.Forms Control and then returns the type. (I need to use Version=2.0.0.0 of System.Windows.Forms)
return Type.GetType("System.Windows.Forms." + name + ", System.Windows.Forms,Culture=neutral, Ve...
I have an interface
public interface FooBar<T> { }
I have a class that implements it
public class BarFoo implements FooBar<Person> { }
With reflection, I want to take an instance of BarFoo and get that the version of FooBar it implements is Person.
I use .getInterfaces from BarFoo to get back to FooBar, but that doesn't help me fin...
Hi;
I am using Ants Profiler to profile my ASP.Net application. The profiler shows the system spend nearly 30% time in "Assembly load or unload" and there was a hit count of 65. Any ideas on how can I optimize the "Assembly load or unload" time??
My ASP.Net application consists of nearly 10 project\dll references. The asp.net applicati...
I have a system which reads strings from the parameters of a GET request, then parses and sends the data along through a very large and complex codebase, which I can't reasonably wrap my head around. These parameters were originally generated from integers at the client, so at it would have been valid to parse these string parameters int...
I know this is possible in python, but can i get a list of methods for a javascript object?
...
i have the following senario:
class Addition{
public Addition(int a){ a=5; }
public static int add(int a,int b) {return a+b; }
}
i am calling add in another class by:
string s="add";
typeof(Addition).GetMethod(s).Invoke(null, new object[] {10,12}) //this returns 22
i need a way similar to the above reflection statement to create ...
I have an IronRuby script like this one:
class MyClassA < NamespaceMaze::BaseClass
description = "I'm MyClassA"
# <snip> some methods
end
class HelperClass; end
class MyClassC < NamespaceMaze::BaseClass
description = "I'm MyClassC"
# <snip> some methods
end
And a .net class like this one:
namespace NamespaceMaze
{
...
Is it possible for me to print all the local, instance variable at runtime on demand. By on Demand I mean like we have jdb -attach <port> which we do at runtime and then we can start debugging... likewise I want to just print all those variables instead of debugging. is it possible?
For example as can be seen, MyDebuggerExample make a c...
I have this class
package somePackage
{
public class SomeClass
{
public static const FOO: SomeClass = new SomeClass("0");
public static const BAR: SomeClass = new SomeClass("1");
}
}
I want to be able to get those static property given it's name.
Example:
public static function getProperty(propertyNam...
Given the following class:
class XMap : ClassMap<X>
{
HasMany(x => x.ListOfY);
HasManyToMany(x => x.ListOfZ);
}
I need a way to read these mappings. Is there a way to detect these? I need something like:
XMap map = new XMap();
var t = GetMappingType(map, "ListOfY"); // somehow returns many-to-one
var t = GetMappingType(map, "...
I would like to decorate my ascx with an attribute so that when I search for types that have that attribute it will appear. The issue is that it seems like I can only add it to the base class which means that when I do a LoadControl on the type I don't get the ascx file, I get base class. I'm trying to avoid having controls require being...
Hi all,
in C# it is possible by using reflection to determine parameter types of some method as well as class members (method, properies..).
I suppose that this is possible because of IL and .NET technology, right ? If so is it possible to use reflection or some similar technique for C/C++ writen under Visual studio 2005/2008/2010 .NET...