5151import org .unicode .idna .IdnaTypes ;
5252import org .unicode .idna .Punycode ;
5353import org .unicode .idna .Uts46 ;
54+ import org .unicode .props .DerivedPropertyStatus ;
55+ import org .unicode .props .UcdProperty ;
5456import org .unicode .props .UcdPropertyValues .Age_Values ;
5557import org .unicode .props .UnicodeProperty ;
5658import org .unicode .props .UnicodeProperty .UnicodeMapProperty ;
@@ -1440,6 +1442,42 @@ public static void showProperties(
14401442
14411443 String kRSUnicode = getFactory ().getProperty ("kRSUnicode" ).getValue (cp );
14421444 boolean isUnihan = kRSUnicode != null ;
1445+ List <UcdProperty > indexedProperties =
1446+ sortedProps .stream ()
1447+ .map (UcdProperty ::forString )
1448+ .filter (p -> p != null )
1449+ .collect (Collectors .toList ());
1450+ List <UcdProperty > ucdProperties =
1451+ indexedProperties .stream ()
1452+ .filter (
1453+ p ->
1454+ p .getDerivedStatus () == DerivedPropertyStatus .Approved
1455+ || p .getDerivedStatus ()
1456+ == DerivedPropertyStatus .Provisional )
1457+ .collect (Collectors .toList ());
1458+ List <UcdProperty > nonUCDProperties =
1459+ indexedProperties .stream ()
1460+ .filter (p -> p .getDerivedStatus () == DerivedPropertyStatus .NonUCDProperty )
1461+ .collect (Collectors .toList ());
1462+ List <UcdProperty > ucdNonProperties =
1463+ indexedProperties .stream ()
1464+ .filter (p -> p .getDerivedStatus () == DerivedPropertyStatus .UCDNonProperty )
1465+ .collect (Collectors .toList ());
1466+ // Non-UCD non-properties, and things added directly in the tools.
1467+ List <String > otherData =
1468+ sortedProps .stream ()
1469+ .filter (
1470+ p ->
1471+ UcdProperty .forString (p ) == null
1472+ || UcdProperty .forString (p ).getDerivedStatus ()
1473+ == DerivedPropertyStatus .NonUCDNonProperty )
1474+ .collect (Collectors .toList ());
1475+
1476+ List <UcdProperty > cjkProperties =
1477+ ucdProperties .stream ()
1478+ .filter (p -> p .getNames ().getShortName ().startsWith ("cjk" ))
1479+ .collect (Collectors .toList ());
1480+ ucdProperties .removeIf (p -> p .getNames ().getShortName ().startsWith ("cjk" ));
14431481
14441482 Age_Values age = Age_Values .forName (getFactory ().getProperty ("Age" ).getValue (cp ));
14451483 VersionInfo minVersion =
@@ -1456,71 +1494,86 @@ public static void showProperties(
14561494 + "</p>" );
14571495 }
14581496
1459- out .append (
1460- "<table class='propTable'>"
1461- + "<caption>"
1462- + (isUnihan ? "non-Unihan properties for U+" : "Properties for U+" )
1463- + hex
1464- + "</caption>"
1465- + "<tr><th>With Non-Default Values</th><th>With Default Values</th></tr>"
1466- + "<tr><td width='50%'>\n " );
1467- out .append ("<table width='100%'>\n " );
1468-
1469- List <String > unihanProperties = new ArrayList <>();
14701497 VersionInfo maxVersion =
14711498 showDevProperties ? Settings .LATEST_VERSION_INFO : Settings .LAST_VERSION_INFO ;
1472- for (String propName : sortedProps ) {
1473- UnicodeProperty prop = getFactory ().getProperty (propName );
1499+ out .append ("<table class='propTable'>" );
1500+ showProperties (
1501+ ucdProperties .stream ().map (UcdProperty ::toString ).collect (Collectors .toList ()),
1502+ (isUnihan ? "Non-Unihan " : "" )
1503+ + "Normative, Informative, Contributory, and (Provisional) UCD properties for U+"
1504+ + hex ,
1505+ cp ,
1506+ minVersion ,
1507+ maxVersion ,
1508+ showDevProperties ,
1509+ out );
1510+ showProperties (
1511+ nonUCDProperties .stream ().map (UcdProperty ::toString ).collect (Collectors .toList ()),
1512+ "Non-UCD properties for U+" + hex ,
1513+ cp ,
1514+ minVersion ,
1515+ maxVersion ,
1516+ showDevProperties ,
1517+ out );
1518+ showProperties (
1519+ ucdNonProperties .stream ().map (UcdProperty ::toString ).collect (Collectors .toList ()),
1520+ "Other " + (isUnihan ? "non-Unihan " : "" ) + "UCD data for U+" + hex ,
1521+ cp ,
1522+ minVersion ,
1523+ maxVersion ,
1524+ showDevProperties ,
1525+ out );
1526+ if (isUnihan ) {
1527+ showProperties (
1528+ cjkProperties .stream ().map (UcdProperty ::toString ).collect (Collectors .toList ()),
1529+ "Unihan Normative, Informative, and (Provisional) properties for U+" + hex ,
1530+ cp ,
1531+ minVersion ,
1532+ maxVersion ,
1533+ showDevProperties ,
1534+ out );
1535+ }
1536+ showProperties (
1537+ otherData ,
1538+ "Other information on U+" + hex ,
1539+ cp ,
1540+ minVersion ,
1541+ maxVersion ,
1542+ showDevProperties ,
1543+ out );
1544+ out .append ("</table>\n " );
1545+ }
1546+
1547+ private static void showProperties (
1548+ List <String > properties ,
1549+ String title ,
1550+ int cp ,
1551+ VersionInfo minVersion ,
1552+ VersionInfo maxVersion ,
1553+ boolean showDevProperties ,
1554+ Appendable out )
1555+ throws IOException {
1556+ out .append ("<tr><th colspan=2>" + title + "</th></tr>" + "<tr><td width='50%'>\n " );
1557+ out .append ("<table width='100%'>\n " );
1558+ for (int i = 0 ; i < properties .size () / 2 ; ++i ) {
1559+ UnicodeProperty prop = getFactory ().getProperty (properties .get (i ));
14741560 if (prop .getName ().equals ("confusable" )) continue ;
1475- if (prop .getFirstNameAlias ().startsWith ("cjk" )) {
1476- unihanProperties .add (propName );
1477- continue ;
1478- }
14791561
1480- boolean isDefault = prop .isDefault (cp );
1481- if (isDefault ) continue ;
1482- showPropertyValue (propName , cp , minVersion , maxVersion , isDefault , out );
1562+ showPropertyValue (properties .get (i ), cp , minVersion , maxVersion , out );
14831563 }
14841564 out .append ("</table>\n " );
14851565
14861566 out .append ("</td><td width='50%'>\n " );
14871567
14881568 out .append ("<table width='100%'>\n " );
1489- for (String propName : sortedProps ) {
1490- UnicodeProperty prop = getFactory ().getProperty (propName );
1569+ for (int i = properties . size () / 2 ; i < properties . size (); ++ i ) {
1570+ UnicodeProperty prop = getFactory ().getProperty (properties . get ( i ) );
14911571 if (prop .getName ().equals ("confusable" )) continue ;
1492- if (prop .getFirstNameAlias ().startsWith ("cjk" )) {
1493- continue ;
1494- }
14951572
1496- boolean isDefault = prop .isDefault (cp );
1497- if (!isDefault ) continue ;
1498- showPropertyValue (propName , cp , minVersion , maxVersion , isDefault , out );
1573+ showPropertyValue (properties .get (i ), cp , minVersion , maxVersion , out );
14991574 }
15001575 out .append ("</table>\n " );
1501-
1502- out .append ("</td></tr></table>\n " );
1503- if (isUnihan ) {
1504- out .append (
1505- "<table class='propTable'>"
1506- + "<caption>"
1507- + "Unihan properties for U+"
1508- + hex
1509- + "</caption>"
1510- + "<tr><td width='50%'>\n " );
1511- out .append ("<table width='100%'>\n " );
1512- for (int i = 0 ; i < unihanProperties .size () / 2 ; ++i ) {
1513- showPropertyValue (unihanProperties .get (i ), cp , minVersion , maxVersion , false , out );
1514- }
1515- out .append ("</table>\n " );
1516- out .append ("</td><td width='50%'>\n " );
1517- out .append ("<table width='100%'>\n " );
1518- for (int i = unihanProperties .size () / 2 ; i < unihanProperties .size (); ++i ) {
1519- showPropertyValue (unihanProperties .get (i ), cp , minVersion , maxVersion , false , out );
1520- }
1521- out .append ("</table>\n " );
1522- out .append ("</td></tr></table>\n " );
1523- }
1576+ out .append ("</td></tr>\n " );
15241577 }
15251578
15261579 private static StringBuilder displayConfusables (int codepoint ) {
@@ -1648,10 +1701,14 @@ private static void showPropertyValue(
16481701 int codePoint ,
16491702 VersionInfo minVersion ,
16501703 VersionInfo maxVersion ,
1651- boolean isDefault ,
16521704 Appendable out )
16531705 throws IOException {
1654- String defaultClass = isDefault ? " class='default'" : "" ;
1706+ String defaultClass =
1707+ getFactory ().getProperty (propName ).isDefault (codePoint ) ? " class='default'" : "" ;
1708+ var indexedProperty = UcdProperty .forString (propName );
1709+ final boolean provisional =
1710+ indexedProperty != null
1711+ && indexedProperty .getDerivedStatus () == DerivedPropertyStatus .Provisional ;
16551712 class PropertyAssignment {
16561713 VersionInfo first ;
16571714 VersionInfo last ;
@@ -1709,12 +1766,12 @@ class PropertyAssignment {
17091766 history .add (current );
17101767 }
17111768 out .append (
1712- "<tr><th><a target='c' href='properties.jsp?a="
1769+ "<tr><th width='50%' ><a target='c' href='properties.jsp?a="
17131770 + propName
17141771 + "#"
17151772 + propName
17161773 + "'>"
1717- + propName
1774+ + ( provisional ? "(" + propName + ")" : propName )
17181775 + "</a></th>" );
17191776 for (PropertyAssignment assignment : history ) {
17201777 String first =
0 commit comments