Skip to content

Commit 75563ba

Browse files
committed
Added some comments.
1 parent 6b2ea3b commit 75563ba

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

src-setup/org/opencms/setup/xml/v8/CmsXmlAddADESearch.java

+31-2
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,36 @@ protected void removeTypes(Node node) {
164164
}
165165
}
166166

167+
/**
168+
* An XML update action which replaces an element given by an XPath with some other XML element.
169+
*/
167170
class ElementReplaceAction extends CmsXmlUpdateAction {
168171

172+
/**
173+
* The XML which should be used as a replacement (as a string).
174+
*/
169175
private String m_replacementXml;
170176

177+
/**
178+
* The xpath of the element to replace.
179+
*/
171180
private String m_xpath;
172181

182+
/**
183+
* Creates a new instance.<p>
184+
*
185+
* @param xpath the xpath of the element to replace
186+
* @param replacementXml the replacement xml
187+
*/
173188
public ElementReplaceAction(String xpath, String replacementXml) {
174189

175190
m_xpath = xpath;
176191
m_replacementXml = replacementXml;
177192
}
178193

194+
/**
195+
* @see org.opencms.setup.xml.CmsXmlUpdateAction#executeUpdate(org.dom4j.Document, java.lang.String, boolean)
196+
*/
179197
@Override
180198
public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
181199

@@ -300,6 +318,13 @@ private String buildXpathForIndexedDocumentType(String source, String doctype) {
300318
return xp.toString();
301319
}
302320

321+
/**
322+
* Creates an action which adds an indexed type to an index source.<p>
323+
*
324+
* @param type the type which should be indexed
325+
*
326+
* @return the update action
327+
*/
303328
private CmsXmlUpdateAction createIndexedTypeAction(final String type) {
304329

305330
return new CmsXmlUpdateAction() {
@@ -327,6 +352,7 @@ private void initActions() {
327352
StringBuffer xp;
328353
CmsXmlUpdateAction action0 = new CmsXmlUpdateAction() {
329354

355+
@SuppressWarnings("unchecked")
330356
@Override
331357
public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
332358

@@ -502,6 +528,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
502528
//
503529
CmsXmlUpdateAction action1 = new CmsXmlUpdateAction() {
504530

531+
@SuppressWarnings("synthetic-access")
505532
@Override
506533
public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
507534

@@ -511,7 +538,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
511538
return true;
512539
}
513540
return false;
514-
};
541+
}
515542
};
516543
xp = new StringBuffer(256);
517544
xp.append(getCommonPath());
@@ -528,6 +555,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
528555
//
529556
CmsXmlUpdateAction action2 = new CmsXmlUpdateAction() {
530557

558+
@SuppressWarnings("synthetic-access")
531559
@Override
532560
public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
533561

@@ -546,7 +574,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
546574
"gallery_fields",
547575
new String[] {"gallery_source", "gallery_modules_source"});
548576
return true;
549-
};
577+
}
550578
};
551579
xp = new StringBuffer(256);
552580
xp.append(getCommonPath());
@@ -563,6 +591,7 @@ public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
563591
//
564592
CmsXmlUpdateAction action3 = new CmsXmlUpdateAction() {
565593

594+
@SuppressWarnings("synthetic-access")
566595
@Override
567596
public boolean executeUpdate(Document doc, String xpath, boolean forReal) {
568597

0 commit comments

Comments
 (0)