문제

우선, 안녕하세요 여러분 (/World)!

나는 Eclipse RCP 앱을 만들고 있습니다. .속성 런타임에 내가 아는 ID 인 일부 플러그인에 위치하고 있습니다.

내가 있는지 알고 싶습니다 쉬운 예를 들어 읽는 방법은 플러그인 *org.anyname.myplugins에서 알고 있습니다.mypluginthatrocks 파일이 이름이 있습니다 myawsomeproperties.properties*, 어떻게 열고 일종의 getter/setter 시스템으로 쉽게 읽을 수 있습니까?

String getInProperties(String fileNameOrPath,String myPropertieId)
void setInProperties(String fileNameOrPath,String myPropertieId,String myPropertieValue)
또는
String getInProperties(File file,String myPropertieId)
void setInProperties(File file,String myPropertieId,String myPropertieValue)
아니면 내가 의미하는 바를 얻는다면 그 유형의 다른 의미는 ...

미리 감사드립니다 ^^

도움이 되었습니까?

해결책

글쎄, 이것들이 Juste Plain Old Properties라면, 좋은 오래된 것이 있습니다 ResourceBundle 그것은 트릭을 할 것입니다.

그러나, 당신이 그것을하고 싶다면, IMHO, 약간 더 깨끗하고, 더 일식 지향적 인 마음으로, 당신은 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 당신이 NLS 클래스를 사용하는지를 사용하는 클래스를 만들 것을 제안합니다. 여기에 설명되었습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top