annotations

spring mvc annotation validation

I have a form that looks like this public class ValidationForm { private Person person; @Size(min=1,max=10,message="out of range") private String test; //other stuff My validation controller is like this public void processForm(@Valid @ModelAttribute("validateForm") ValidationForm vform, BindingResult result){ My Person ...

Mapkit with multiple annotations

Hi All, I have a map displaying multiple annotations. I'd like to mimic the behavior of the Places tab on the Photos built-in app (iOS 4), where the annotations are automatically joined together or splited apart as the user changes the zoom level. How do I do that? Thanks! ...

Using 2 different MKAnnotationViews on one Mapview, one for own Position, one to show sth.

How can i get it, that the current Location gets the normal Pin-Annotation and an Annotation made by own Software gets an Image as Annotation ? I could believe with an if in the -(MKAnnotationView*)mapView(...) viewForAnnotation: But on which property can i decide if its my own Annotation or if it is the Apple-Annotation ? ...

How to Automatically Display Title/Subtitle on Map Annotation (pin)

I am loading an annotation onto my map view. The annotation displays as a pin when the map is loaded. However, the title and subtitle do not appear on the pin automatically. Currently, the user is required to tap on the pin before the title displays. Is there a way to get the title to display automatically on the pin when the map is lo...

Java getter/setter generation with Lombok for code with annotations

I use Project Lombok to automatically generate getter and setter methods for all fields of a Java class. When a field is annotated with e.g. @XmlTransient, the annotation is not propagated to the generated getter/setter methods, thus in the resulting code it does not show any effect. Is there a way to use automatic getter/setter genera...

how can I add xml attributes to jaxb annotaded class XmlElementWrapper

I have a class with a XmlElementWrapper annotation like: ... @XmlElementWrapper(name="myList") @XmlElements({ @XmlElement(name="myElement") } ) private List<SomeType> someList = new LinkedList(); ... This code produces XML like <myList> <myElement> </myElement> <myElement> </myElement> <myElement> </myElemen...

Transactions not working unless inside DAO

I have a problem with transactions in that annotating a service that calls a DAO with @Transactional throws an exception stating that the Session is not open. The only way I can get it working is by annotating the DAO with @Transactional. What on earth can be happening? This is what I'd like to do but doesn't work: class CustomerServic...

Do I have access to annotations through freemarker?

I am rendering a form to present an annotated domain model class, i.e.: @Entity class User { @NotNull private String name; // other code } I would like to read the annotated meta-data to decide how to render each property. I would use it to add css classes to my input tags and finally use jQuery to attach validation metho...

annotation invisible?

This puzzles me. I have a class with a custom annotation and I can't seem to verify that the annotation is present. What am I doing wrong here? If I run MyOperationTest (see below), I get this as a result: implements Library.Operation: true has @Library.Marker: false Tada! Library.java: package com.example.gotchas; public class Li...

Javascript Libraries for Annotating Text?

Hi there, I have googled and come up dry. I am looking for a way to annotate text selections (with overlaps) and i was wondering if anyone knows of something like this available already? My goal/use case is that a number of users will be presented the same blob of text and should all be able to independently annotate various selecti...

Do PHP developers use annotations?

Hi, I'm creating a server library in PHP, and I was thinking to use annotations. I'm a Java developer and I use annotations intensively (also because it's a language feature). I know in PHP there are some annotation libraries, but nothing officially supported. So, have you ever used annotations in your PHP project? Thanks ...

map default column value with annotations

@Entity @Table(name = "J_CNTRY") public class CountryEntity { @Id @GeneratedValue(strategy = GenerationType.TABLE, generator = "myTableGenerator") @TableGenerator(name = "myTableGenerator", allocationSize = 5, pkColumnName = "pkName", valueColumnName = "pkValue", table = "j_cntry_pk_table") private Long id; private ...

Java 6: how to pass multiple parameters to APT

I have a Java Annotation Processor that extends from AbstractProcessor. I have two supported options, addResDir and verbose, and I am trying to set them like this: -AaddResDir=src/main/webapp -Averbose=true I have also tried this: -AaddResDir=src/main/webapp,verbose=true While a single parameter works, e.g. -AaddResDir=src/main/w...

configure java compiler so that it gives an error on missing annotations

hello, how can i configure the javac compiler to give an error instead of a warning when an annotation like @Override is missing? it should work on java 5. ...

Get the attribute name/string of a class with attribute

Hello, I have a classes called BillingActivity, DevelopmentActivity, ResearchActivity all implementing IActivity. Somewhere in my app I enumerate a dll containing all types. Check wether typeof(IActivity).IsAssignable(type) if so I want to get string typeDescription = type.Attribute.Value or similar what I want is to put a attribute on...

[Required] attribute dependent on another field

Hi, In a model of my ASP.NET MVC application I would like validate a textbox as required only if a specific checkbox is checked. Something like public bool retired {get, set}; [RequiredIf("retired",true)] public string retirementAge {get, set}; How can I do that? Thank you. ...

Trouble using UILongPressGestureRecognizer in custom MKAnnotationView

Having trouble with a UILongPressGestureRecognizer in a custom subclass of MKAnnotationView. The callback is fired only intermittently. If I make the minimumPressDuration shorter, it fires more frequently. With a minimumPressDuration value of 0.1, it fires every time. With a value of 0.4, it never fires at all, no matter how long I l...

mvc:annotation-driven Spring mvc 3 and Tuckey URL Filter

hi All, I was using Tuckey url for url re-writing. This is how it looks: rule from / from to /pf/welcome to (changed format to enter into this forum, regular xml tags are used) rule and this is how I have my entitymanager set up in web.xml: OpenEntityManagerInViewFilter /*--> /pf/* FORWA...

Persist enum with business value with hibernate annotations.

I have enum ClientType{INTERNAL,ADMIN}, i am able to persist enum with hibernate annotations. but inserted value is INTERNAL,ADMIN. How can i define my own vlaue. I want table to contain "I" for INTERNAL. How can i do this hibernate annotations. ...

How does JSF find beans annotated with @ManagedBean?

As far as I know, for using @Annotations (or [Attributes] in C#) you have to have a reference to the class metadata, so that you can ask if the class is annotated (attributed) or not. My question is how does JSF implementation find all classes annotated with @ManagedBean? Does it scan all of the classes in the class path? Or is there a ...