Include constant String values in javadoc?
I just got tired of search/replace in JavaDoc parts and asked myself if the following is possible:
(I use JSP Syntax for the part that I don't know if it's posible)
public static String insert = "this ist the insert";
* Display here: <%=insert%>
*/Any ideas!?
Was this {@value variable} feature ever implemented?
I really think is is a great idea and wish I could
use it.It has been added for 1.5. For 1.4 you can use this simple taglet:
import com.sun.tools.doclets.Taglet;
import com.sun.tools.doclets.standard.HtmlStandardWriter;
import com.sun.tools.doclets.standard.tags.AbstractInlineTaglet;
import com.sun.javadoc.*;
import java.util.Map;
public class MyValueTaglet extends AbstractInlineTaglet {
private static final String NAME = "my.value";
* Return the name of this custom tag.
public String getName() {
return NAME;
public boolean inField() {
return true;
public boolean inConstructor() {
return true;
public boolean inMethod() {
return true;
public boolean inOverview() {
return false;
public boolean inPackage() {
return false;
public boolean inType() {
return true;
public boolean isInlineTag() {
return true;
* Register this Taglet.
* @param tagletMap the map to register this tag to.
public static void register(Map tagletMap) {
MyValueTaglet tag = new MyValueTaglet();
tagletMap.put(tag.getName(), tag);
public String toString(Tag tag, Doc doc, HtmlStandardWriter hsw) {
ClassDoc lookup = null;
if ( doc instanceof ClassDoc )
lookup = (ClassDoc)doc;
else if ( doc instanceof MemberDoc )
lookup = ((MemberDoc)doc).containingClass();
if ( lookup == null )
return "";
final String fieldName = tag.text();
final FieldDoc[] fields = lookup.fields();
for (int i = 0; i < fields.length; ++i)
if ( fieldName.equals( fields.name() ) )
final Object value = fields[i].constantValue();
return (value != null) ? value.toString() : "";
return "";
Note:
In order to get this to work project wide, you need to have full qualified names as tag text and use the RootDoc to locate the appropriate packages and classes.
Similar Messages
-
Parameters To Include Null Or Empty String Values
I have a table that has both Nulls & Empty Strings that I want to use as a Dynamic Parameter. Even though there is an indication of the Null/Empty String value when the parameter prompt comes up, selecting the value of Null/Empty String results in no records being returned. I have a formula to display the values in the report (where I substitute "Unknown" for the Null/Empty String values), but I am not able to do a parameter on that formula.
I guess in general, this is a situation of needing to be able to use a Dynamic Parameter based on a formula field.
Thanks for any assistance!
Edited by: Dragon77 on Apr 2, 2010 9:39 AMI'd use a SQL Command as the data source for the list of values. Something like this... (MS SQL Server)
SELECT DISTINCT
CASE WHEN t.StringField IS NULL OR t.StringField LIKE ''
THEN 'Unknown' ELSE t.StringField END AS StringField
FROM TableName AS t
ORDER BY StringField
Then use a formula like this in the selection criteria.
IF {?Parameter} = "Unknown"
THEN (ISNULL ({TableName.StringField}) OR {TableName.StringField} LIKE "")
ELSE {TableName.StringField} = {?Parameter}
HTH,
Jason -
How to update a string value located on the main VI
Hello
I would like, from a subVI, to update a string value located in the main VI (using References). I was trying to find examples on NI web page but it´s impossible to download them (for more than one month : Error, File Not Found), do everyone has got the same problem?
Thanks for your answer
NicolasHi,
this is from LV help file:
Complete the following steps to create a subVI that includes a control reference directly from a Property Node.
1.On the block diagram, right-click the front panel object terminal for which you want a control reference and select Create»Property Node from the shortcut menu to create a Property Node implicitly linked to the object. You can have multiple Property Nodes for multiple front panel objects.
2.Use the Positioning tool to select the new Property Node and select Edit»Create SubVI from menu. LabVIEW automatically creates a control reference to the control on the block diagram of the main VI, creates a subVI that contains a control refnum wired to a Property Node, and wires the control reference on the main VI to the
control refnum input terminal of the new subVI.
Note: Select several Property Nodes at once to create a subVI with multiple control refnums and Property Nodes.
3.Double-click the subVI to open it. Modify the Property Node and other elements of the subVI as you do in any other VI.
4. If you want to change values of control then select "Value" property in Property node.
I've attached the examples.
Good luck.
Oleg Chutko.
Attachments:
Ref.zip 11 KB -
Why Would Crystal Change all "string" values to hexidecimal
We are running Crystal Reports version 11 and using it to access a ISeries DB2 Database. We use the OLE DB (ADO) connedction to the ISeries. We have had several reports running for months, then last Friday when we ran one of the reports Crystal indicated "The database file XXXX has changed; Proceeding to fix up the Report".
When we click OK the fix appears to take place BUT the report fails with a SQL0103 Numeric Contant error. The error is on a "Character" fields but the value has a 0x prefixed to the string. If I look at teh SQL, the SQL being run, it is bad, it has 0x prefixed to teh criteria used on the where and the value is being treated as numeric, it does not contain the single quotes.
Also, after the so called "Database Changed; proceeding to fix", If I display the values in the database for any of the "String" defined fields....the display shows them in hexidecimal.
The Tables Crystal thinks has changed HAVE NOT changed. There are no modifications to these tables so I'm not quite sure why Crystal thinks they have been changed.
I'm not sure if I'm in the proper forum or not. I wanted to call Crystal support BUT it appears they have abonded talking to users, now we must go through forums.
If any one can help on this mees, I'd appreciate it.
Edited by: Blake Bray on Jul 28, 2008 8:40 PMCrystal reports tries to find any differences in the database structure, Crystal displays a message to the
effect that u201CThe database file u2018tblxxxxu2019 has been changed. Proceeding to fix up the report!u201D.
You will see this message once for each table that does not match Crystalu2019s internal map
of that table. The OK button (your only option) in response to this available.
If a Report includes subreports, then, when you do a verify the database operation (from the main report),
Crystal checks the main report and all the subreports to see if any of the tables have changed. If it finds any
tables that have changed, it displays the same u201Cu2026u2026Proceeding to fix up the report!u201D message and you must
click OK on all those messages. Next, you must rerun the verify operation again, until you get the u201CThe
database is up to dateu201D message, once for the main report and once for each subreport. (For example, if a
report includes 3 subreports, you will get the u201CThe database is up to dateu201D message four times).
if you do not have the data enclosed in single quotes once the sql statement is assembled, tries to make it into a number. look at your string value of your sql statement and check that you have everything in the correct ; I suspect you have a missing set of single quotes.
Thanks,
Parsa. -
How to write the map expression for a const string
hi all,
i am trying to map from source table A to target table B. Table B has a column that A doesn't have and the column type is string.
what should i do if i want to keep this column a const string like "abc"? How to write the map expression?
Setting a default value like "abc" of this column in database is not available .
please try to help, thanks a lot.
junHi jun,
You mean, u want to give some hard coded value to a specific column in mapping?
If so , give 'abc' in the target column and execute it on Target.
Thanks,
Guru -
How to connect input string value to numerical values
Hello,
I am trying to figure out how to connect a single user's input string value to numerical values. Basically I want the user to input the name of a gas that I have a list for (I believe i put the list of gasses in an array>). Then I want to match 2 numerical values "a" and "b" depending on which gas name the user has put in. These "a" and "b" values will be automatically matched with the gas name from a list I put. For example the gas hydrogen has a value of 3 for "a" and 4 for "b. so when the user puts the name "hydrogen" in a string constant, automatically "a" and "b" should be outputted. I will be connecting a and b to a formula
Thanks for any help
Solved!
Go to Solution.student11 wrote: These "a" and "b" values will be automatically matched with the gas name from a list I put. For example the gas hydrogen has a value of 3 for "a" and 4 for "b".
This sounds a lot like an Enum to me. Make sure you type def the enum to make sure updates quickly and easily make it to all copies of the enums.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
How to get string value from xml in JSF??
In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF
Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization. -
How to get string value from database table using Visual Studio 2005?
Hi,
Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
Im using the below code to get the values from database table
bool Table::Get(char* FieldName,int& FieldValue)
try
_variant_t vtValue;
vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
FieldValue=vtValue.intVal;
CATCHERRGET
sprintf(m_ErrStr,"Success");
return 1;
Im using the below code to get the values.
AIErr getProjects()
char buf[5000];
int i;
std::string catName;
::CoInitialize(NULL);
Database db;
Table tbl;
errno_t err;
err = fopen(&file,"c:\\DBResult.txt","w");
fprintf(file, "Before Connection Established\n");
//MessageBox(NULL,CnnStr,"Connection String",0);
if(!db.Open(g->username,g->password,CnnStr))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
fprintf(file, "After Connection Established\n");
if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
int ProjectID;
int UserID;
int ProjectTitle;
char ProjectName[ProjectNameSize];
if(!tbl.ISEOF())
tbl.MoveFirst();
ProjectArrCnt=0;
for(i=0;i<128;i++)
buf[i]='\0';
int j=0;
while(!tbl.ISEOF())
if(tbl.Get("ProjectID",ProjectID))
fprintf(file,"Project ID: %d ",ProjectID);
ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
sprintf(buf,"%d",ProjectID);
//MessageBox(NULL, buf,"f ID", 0);
j++;
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
//if(tbl.Get("ProjectTitle",ProjectName))
if(tbl.Get("ProjectName",ProjectName))
MessageBox(NULL,"Inside","",0);
fprintf(file,"ProjectTitle: %s\n",ProjectName);
//catName=CategoryName;
ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
//sprintf(buf,"%s",ProjectName);
MessageBox(NULL,(LPCSTR)ProjectName,"",0);
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
ProjectArrCnt++;
//MessageBox(NULL, "While", "WIN API Test",0);
tbl.MoveNext();
//MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
::CoUninitialize();
//sprintf(buf,"%s",file);
//MessageBox(NULL,buf,"File",0);
fprintf(file, "Connection closed\n");
fclose(file);
for(i=0;i<ProjectArrCnt;i++)
sprintf(buf,"%i",ProjectInfo[i].ProjectID);
//MessageBox(NULL,buf,"Proj ID",0);
//MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
return 0;
In the above code im geeting project D which is an integer value. But not able to get the project name.
Please some one guide me.As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.
-
Getting string values from DB query
I am using the following code:
<%@ page import="java.sql.*" %>
<%
String userName = request.getParameter("usernameField");
String password = request.getParameter("passwordField");
String connectionURL = "jdbc:mysql://localhost:3306/babbemployees?user=DBUser;password=MyPassword";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection (connectionURL, "DBUser", "MyPassword");
statement = connection.createStatement();
String queryString = "SELECT * FROM tbemployees where userID='"+userName+"'";
rs = statement.executeQuery(queryString);
String isAuthenticated;
if (userName == rs.getString("userID") && password == rs.getString("password")[0])
isAuthenticated = "AUTHENTICATED";
else
isAuthenticated = "NOT AUTHENTICATED";
rs.close();
%>
<html>
<body>
<h1><%= isAuthenticated %></h1>
<hr>
</body>
</html>I am trying to get a String value for rs.getString() but for some reason this is not working out. Is there anything I can do to get the values for the queries in a String value?
Thanks,
HarlinWhen a ResultSet is returned to you, it is always positioned before the first row.
You need to insert a rs.next(); after your executeQuery(). -
How do I know if I can convert a String value to an int value or not?
Hi,
I want to know how to make the judgment that if I can convert a String value to an int value or not? Assume that I don't know the String is number or letters
Thank youEncephalopathic wrote
Again, why?One of the problems (have been dued) in my codelab asks us to write a class as follow
Write a class definition of a class named 'Value' with the following:
a constructor accepting a single integer paramter
a constructor with no parameters
a method 'setVal' that accepts a single parameter,
a boolean method, 'wasModified' that returns true if setVal was ever called for the object.
a method 'getVal' that returns an integer value as follows: if setVal has ever been called, it getVal returns the last value passed to setVal. Otherwise if the "single int parameter" constructor was used to create the object, getVal returns the value passed to that constructor. Otherwise getVal returns 0.
The setVal(int y) returns nothing, so how do I know whether it has been called or not?
Thank you -
Can't assign a string value to a member of type TEXT in Calculation Manager
I can assign a string value to that member of type TEXT using a run-time prompt of type StringToNumber.
Example: "My Text Member" = {string_rtp};
However, I need to accompllish the same function without using a run-time prompts.
I have a planning application and I know that text along with all other non-numeric
values are stored on the relational side in the planning application schema.
It seems reasonable to assume that if this can can accomplish
with a run-time prompt that I could do also do it without a run-time prompt.
What appears to be lacking is a function like:
"My Text Member" = @StringToNumber(<String Literal>);
Clearly, this is already being done "under the covers" for run-time prompts. If
would appear to be a minor enhancement to expose such a function to developers.
NOTE: I suppose you would also need to add new syntax/function to identify a string
literal from say a member name. I'm wondering if this is the more difficult challenge
from a product perspective????When executing a Calculation Manager rule in Planning, the run-time prompt (RTP) is populated by looking up the outline information present in the relational Planning application database. If the RTP is of type TEXT, the strings displayed in the member select are from the from the relational Planning application database too. Subsequently when executing the Rule, the RTP's value is in fact the record ID (a number) which is then saved into the appropriate intersection in Essbase.
You need to bear in mind, the Rule is executed in Essbase. If Essbase needs to "write" a text, it would then need to connect to the Planning relational database to create a new record. The newly created record ID then needs to be feed back to Essbase, in order to store it in the appropriate intersection.
What you are suggesting, comes with a big overhead causing Essbase and the rule to slow. Thus, the disadvantages outweighs the advantages. -
How to generate a Unique key based on a some String value
Hello every one,
I am sorry , If I post this question in wrong group... I have a requirement to generate a unique key ( what every it may be alpha, numeric or alpha numeric) based on some String..
For ex : String str = "AbCX" - Gives a unique key based on "AbCX" value..
Is there any way we can get the unique value using Java ?
ThanksMay be not what you are looking for, but here's may idea:
use a sequence (db sequence) and add it the the string value. This way the value is unique, because the sequence is unique. So you could omit the string theoretically, but your requirement is met.
It's very easy to get a unique sequence number from the db using java, depending of the technology you use (which you did not say :-( )
Timo -
Hi,
I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
http://server/pages/Default.aspx?Title=Arup&Title=Ratan
But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
I have followed the
http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
Please suggest me.
Thanks | Arup
THanks! Arup R(MCTS)
SucCeSS DoEs NOT MatTer.Hi DH, sorry for not being clear.
It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
(or a Performance Point Dashboard etc.) and you insert it into your page and add
a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
with multiple values for one parameter. If you have any more questions let me know. See you, Ingo -
I'm using TestStand 2.0/Labview 6i to do a string value test. Is there any way to use a string variable in the edit string value test instead of an actual string?? This forces you to hard code a string to test against.
Hi ART,
You can also use the LimitLoader step to load your string into to step similar to the Numeric Step type.
There should be an example of this in the Resource Library | TestStand
Regards
Ray Farmer
Regards
Ray Farmer -
Runtime conversion of a string value to a primitive data type in java
can anyone of you give me an idea to convert a string value to a primitive data type during run time...i have the value and the type to which it has to be converted as String values...do you have any idea ,...pls share
String recvalvalue = inputval;
String recvartype = inputtype;
if (recvartype.equals("int")){
value0 = Integer.parseInt(recvalvalue);
else
if (recvartype.equals("double")){
value1 = Double.parseDouble(recvalvalue);
else
if(recvartype.equals("float")){
value2 = Float.parseFloat(recvalvalue);
else
if(recvartype.equals("Boolean")){
value3 = Boolean.parseBoolean(recvalvalue);
else
if(recvartype.equals("char")){
value4 = (char)recvalvalue.charAt(0);
else
if(recvartype.equals("String")){
value5 = recvalvalue;
else
if(recvartype.equals("byte")){
value6 = Byte.parseByte(recvalvalue);
//listA.add(6, value6);
// listA.g = value6;
else
if(recvartype.equals("long")){
value7 = Long.parseLong(recvalvalue);
else
if(recvartype.equals("short")){
value8 = Short.parseShort(recvalvalue);
} yes i can do this but the resultant value has to be assigned to a variable of a specific type which is here recvartype .....it has to be done dynamically automatically..if we know what type of data is that we can convert and assign to the type but we donot know when we run the program as the program will be supllied by someone and has to be executed
Maybe you are looking for
-
Trying to copy iPhoto Library to external hard drive for backup. Error message: The Finder can't complete the operation because some data in "iPhoto Library" can't be read or written (Error code -36).
-
Greetings to all. There is currently a bug in the Mini's firmware that poses as a slight problem for me. I'm sure some people are aware of this, but Apple has yet to present a solution. Problem: While booting a Legacy OS, such as Linux (Grub/LILO), o
-
OSX 10.5.8 to Mavericks?
Hello, My July 2009 MacBook is currently running the same OSX 10.5.8 it came with. If I purchase Snow Leopard from the Mac store online and install it, will I be able to then install Mavericks OSX 10.9? If I can, what will happen exactly? I have iLif
-
I have a web chat room application used textflow to render the user message embed swf emotions. After I updated to flex 4.5 sdk, I get these errors oftenly and I just can't debug with it so I don't where went wrong exactly. Please Help me out , or ju
-
Exporting from ios 7 iphoto to mac iphoto
Hello. Is there an easy (and logical) way to export photos from ios 7 iphoto to mac iphoto? I thought they had better (if any) integration. I recently travelled to Asia and took pictures only with the iphone. As I take pictures of everything around m