Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355219 - Make namespace handling optional for named SlotEntry
Summary: Make namespace handling optional for named SlotEntry
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-19 09:29 EDT by Robert von Massow CLA
Modified: 2017-10-31 11:31 EDT (History)
1 user (show)

See Also:
sven.efftinge: kepler+


Attachments
This patch adds a boolean property to the SlotEntry class (2.19 KB, patch)
2011-08-19 09:33 EDT, Robert von Massow CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert von Massow CLA 2011-08-19 09:29:59 EDT
Build Identifier: git: 0be8a0cd9c433d0e6d4a42f769a5ecb4a7e5d052

In my grammar, I use only simple names which can be arbitrary Strings. When I try to read a document into a slot with a name like "Xtext 2.0 Documentation", the default behavior would be to check if the QualifiedName of an object is matching ["Xtext 2", "0 Documentation"], so it would never match the actual QualifiedName ["Xtext 2.0 Documentation"]. Of course I could change the namespace delimiter to some string that would most likely not be used in a name, but I consider that to be a very ugly solution. In the attached patch I propose to add a boolean property like "useNamespaces", to make that behavior configurable. Please correct me, if this behavior is intended not to be configurable, so I can subclass the reader and add the field in my project.

Reproducible: Always

Steps to Reproduce:
1. create a new Xdoc project (prior to d60ef2c, i added the aforementioned ugly workaround)
2. name the document something like "foo.bar"
3. try to compile the pdf document
Comment 1 Robert von Massow CLA 2011-08-19 09:33:58 EDT
Created attachment 201798 [details]
This patch adds a boolean property to the SlotEntry class
Comment 2 Sven Efftinge CLA 2011-08-22 02:19:15 EDT
We should pass in and use a QualifiedNameConverter from the injector in the checkConfigurationInternal phase of AbstractReader.
For now setting a non existent namespaceDelimiter (e.g. '$%§$&§&§') should also work.
Comment 3 Sven Efftinge CLA 2012-11-23 02:49:56 EST
If the property 'namespaceDelimiter' is set to an empty string (or null) no delimiter will be used.
Instead a comparison by string (using toString() on the EObjectDescription's name) is done.


	/**
	 * The delimiter to use for the names. When not set the dot (".") is used.
	 * Must be set to an empty string ("") if no delimiter should be used.
	 */
	public void setNamespaceDelimiter(String namespaceDelimiter) {
		this.namespaceDelimiter = namespaceDelimiter;
	}
	
pushed to master.
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:31:20 EDT
Requested via bug 522520.

-M.