Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » Tags with attributes and a simple content
icon4.gif  Tags with attributes and a simple content [message #924921] Thu, 27 September 2012 04:34 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEE
Messages: 59
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 04:44 Go to previous message
Greg Amerson is currently offline Greg Amerson
Messages: 116
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 04:46]

Report message to a moderator

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


Current Time: Mon Jul 28 20:48:06 EDT 2014

Powered by FUDForum. Page generated in 0.07976 seconds