Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Tags with attributes and a simple content
icon4.gif  Tags with attributes and a simple content [message #924921] Thu, 27 September 2012 08:34 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
First, I'd like to thank you all for the GREAT effort you guys do Smile

If I have a Tag like this:

<data keyword="SampleTi">
      <resolution>0.001</resolution>
</data>


I will simply create a class named IData.java:

public interface IData extends IModelElement
{
	ModelElementType TYPE = new ModelElementType( IData.class );

	// *** Keyword ***
	@Label(standard = "&Keyword")
	@XmlBinding ( path = "@keyword" )
	ValueProperty PROP_KEYWORD = new ValueProperty(TYPE, "Keyword");
	Value<String> getKeyword(); void setKeyword(String value);

	// *** Resolution ***
	@Label(standard = "&Resolution")
	@XmlBinding ( path = "resolution" )
	ValueProperty PROP_RESOLUTION = new ValueProperty(TYPE, "Resolution");
	Value<String> getResolution(); void setResolution(String value);
}


but for the Tag:

<data keyword="SampleTi">
      simple content
</data>


I still have to create a class named "IData.java" in order to get the "keyword" exactly the same as the previous example:

public interface IData extends IModelElement
{
	ModelElementType TYPE = new ModelElementType( IData.class );

	// *** Keyword ***
	@Label(standard = "&Keyword")
	@XmlBinding ( path = "@keyword" )
	ValueProperty PROP_KEYWORD = new ValueProperty(TYPE, "Keyword");
	Value<String> getKeyword(); void setKeyword(String value);
}


but now, how can I get the string "simple content"?
Re: Tags with attributes and a simple content [message #924930 is a reply to message #924921] Thu, 27 September 2012 08:44 Go to previous message
Greg Amerson is currently offline Greg AmersonFriend
Messages: 119
Registered: March 2010
Senior Member
Try this...

public interface IData extends IModelElement
{
	ModelElementType TYPE = new ModelElementType( IData.class );

	// *** Keyword ***
	@Label(standard = "&Keyword")
	@XmlBinding ( path = "@keyword" )
	ValueProperty PROP_KEYWORD = new ValueProperty(TYPE, "Keyword");
	Value<String> getKeyword(); void setKeyword(String value);

	// *** SimpleContent ***
	@Label(standard = "&Simple Content ")
	@XmlBinding ( path = "" )
	@Whitespace( trim = false )
	ValueProperty PROP_SIMPLE_CONTENT = new ValueProperty(TYPE, "SimpleContent");
	Value<String> getSimpleContent(); void setSimpleContent(String value);
}

[Updated on: Thu, 27 September 2012 08:46]

Report message to a moderator

Previous Topic:Sapphire at GitHub
Next Topic:Announcing Sapphire 0.5.3 Release
Goto Forum:
  


Current Time: Thu Apr 25 03:52:34 GMT 2024

Powered by FUDForum. Page generated in 0.03076 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top